mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-08-25 00:42:32 +00:00
180 lines
4.9 KiB
Text
180 lines
4.9 KiB
Text
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
template GradiencePresetWindow : Adw.Window {
|
|
title: _("Presets");
|
|
default-width: 650;
|
|
default-height: 500;
|
|
modal: true;
|
|
|
|
ShortcutController {
|
|
Shortcut {
|
|
trigger: "Escape";
|
|
action: "action(window.close)";
|
|
}
|
|
}
|
|
|
|
Adw.ToastOverlay toast_overlay {
|
|
Adw.Leaflet leaflet {
|
|
can-navigate-back: true;
|
|
can-unfold: false;
|
|
|
|
Gtk.Box main_view {
|
|
orientation: vertical;
|
|
|
|
Adw.HeaderBar titlebar {
|
|
centering-policy: strict;
|
|
|
|
Button import_button {
|
|
styles ["suggested-action"]
|
|
label: _("Import");
|
|
tooltip-text: _("Import a Preset File");
|
|
clicked => on_import_button_clicked();
|
|
}
|
|
|
|
Button remove_button {
|
|
styles ["danger"]
|
|
label: _("Delete");
|
|
visible: false;
|
|
}
|
|
|
|
[title]
|
|
Adw.ViewSwitcherTitle title {
|
|
stack: view_stack;
|
|
}
|
|
|
|
[end]
|
|
Button file_manager_button {
|
|
tooltip-text: _("Open in File Manager");
|
|
clicked => on_file_manager_button_clicked();
|
|
Adw.ButtonContent {
|
|
icon-name: "folder-symbolic";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
Gtk.Box {
|
|
orientation: vertical;
|
|
|
|
Adw.ViewStack view_stack {
|
|
vexpand: true;
|
|
hexpand: true;
|
|
|
|
Adw.ViewStackPage {
|
|
name: "installed";
|
|
title: _("Installed");
|
|
icon-name: "larger-brush-symbolic";
|
|
|
|
child: Adw.PreferencesPage installed { };
|
|
|
|
}
|
|
|
|
Adw.ViewStackPage {
|
|
name: "explore";
|
|
title: _("Explore");
|
|
icon-name: "web-browser-symbolic";
|
|
|
|
child: Gtk.ScrolledWindow {
|
|
Adw.StatusPage {
|
|
title: _("Search for presets");
|
|
description: _("Enter a keyword to search on <a href=\"https://github.com/GradienceTeam/Community\">GradienceTeam/Community</a>.");
|
|
valign: start;
|
|
Adw.Clamp {
|
|
styles ["clamp"]
|
|
|
|
Gtk.Box {
|
|
orientation: vertical;
|
|
|
|
Gtk.Box {
|
|
styles ["linked"]
|
|
|
|
Gtk.SearchEntry search_entry {
|
|
hexpand: true;
|
|
placeholder-text: _("e.g. \"Pretty Purple\"");
|
|
}
|
|
|
|
Gtk.DropDown search_dropdown {
|
|
model: StringList search_string_list {
|
|
strings [_("All")]
|
|
};
|
|
}
|
|
}
|
|
|
|
Gtk.Stack search_stack {
|
|
Gtk.StackPage {
|
|
name: "page_spinner";
|
|
child: Gtk.Spinner search_spinner {
|
|
valign: start;
|
|
halign: center;
|
|
spinning: true;
|
|
};
|
|
}
|
|
|
|
Gtk.StackPage {
|
|
name: "page_results";
|
|
child: Gtk.ListBox search_results {
|
|
styles ["boxed-list"]
|
|
valign: start;
|
|
selection-mode: none;
|
|
};
|
|
}
|
|
|
|
Gtk.StackPage {
|
|
name: "page_empty";
|
|
child: Adw.StatusPage {
|
|
icon-name: "system-search-symbolic";
|
|
title: _("No Results Found");
|
|
};
|
|
}
|
|
|
|
Gtk.StackPage {
|
|
name: "page_offline";
|
|
child: Adw.StatusPage {
|
|
icon-name: "network-wireless-offline-symbolic";
|
|
title: _("Offline");
|
|
};
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
// NOTE: This group is disabled as there isn't yet any implementation of custom repositories in Gradience
|
|
Adw.ViewStackPage {
|
|
name: "repos";
|
|
title: _("Repositories");
|
|
icon-name: "folder-symbolic";
|
|
visible: false;
|
|
|
|
child: Adw.PreferencesPage repos { };
|
|
|
|
}
|
|
}
|
|
|
|
Adw.ViewSwitcherBar {
|
|
stack: view_stack;
|
|
reveal: bind title.title-visible;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Gtk.FileChooserNative import_file_chooser {
|
|
title: _("Import a Preset File (*.json)");
|
|
modal: true;
|
|
}
|
|
|
|
Gtk.FileFilter all_filter {
|
|
name: _("All files");
|
|
mime-types ["application/octet-stream"]
|
|
}
|
|
|
|
Gtk.FileFilter json_filter {
|
|
name: _("JSON file (*.json)");
|
|
mime-types ["application/json"]
|
|
}
|