Gradience/data/ui/presets_manager_window.blp

164 lines
4.4 KiB
Text
Raw Normal View History

2022-08-15 13:40:21 +00:00
using Gtk 4.0;
using Adw 1;
2022-08-22 13:21:56 +00:00
template GradiencePresetWindow : Adw.Window {
title: _("Presets");
2022-08-22 13:57:08 +00:00
default-width: 600;
default-height: 400;
2022-08-15 13:40:21 +00:00
2022-08-22 13:21:56 +00:00
Adw.ToastOverlay toast_overlay {
Adw.Leaflet leaflet {
can-navigate-back: true;
can-unfold: false;
2022-08-15 13:40:21 +00:00
2022-08-22 13:21:56 +00:00
Gtk.Box main_view {
orientation: vertical;
2022-08-15 13:40:21 +00:00
2022-08-22 13:21:56 +00:00
Adw.HeaderBar titlebar {
centering-policy: strict;
[start]
2022-08-22 13:57:08 +00:00
Button import_button {
2022-08-22 13:21:56 +00:00
styles ["suggested-action"]
label: _("Import");
2022-08-23 09:46:51 +00:00
clicked => on_import_button_clicked();
2022-08-22 13:21:56 +00:00
}
2022-08-15 13:40:21 +00:00
2022-08-22 13:21:56 +00:00
[start]
2022-08-22 13:57:08 +00:00
Button remove_button {
styles ["danger"]
2022-08-22 13:21:56 +00:00
label: _("Delete");
visible: false;
}
[title]
Adw.ViewSwitcherTitle title {
stack: view_stack;
}
2022-08-15 13:40:21 +00:00
2022-08-22 13:21:56 +00:00
[end]
2022-08-22 13:57:08 +00:00
Button file_manager_button {
2022-08-22 13:21:56 +00:00
tooltip-text: _("Open in file manager");
2022-08-23 08:36:20 +00:00
clicked => on_file_manager_button_clicked();
2022-08-22 13:21:56 +00:00
Adw.ButtonContent {
icon-name: "folder-symbolic";
}
}
2022-08-22 13:57:08 +00:00
2022-08-22 13:21:56 +00:00
}
2022-08-20 02:07:31 +00:00
2022-08-22 13:21:56 +00:00
Gtk.Box {
orientation: vertical;
2022-08-20 02:07:31 +00:00
2022-08-22 13:21:56 +00:00
Adw.ViewStack view_stack {
vexpand: true;
hexpand: true;
2022-08-20 02:07:31 +00:00
2022-08-22 13:21:56 +00:00
Adw.ViewStackPage {
name: "installed";
title: _("Installed");
icon-name: "larger-brush-symbolic";
child: Adw.PreferencesPage installed { };
2022-08-20 02:07:31 +00:00
}
2022-08-22 13:21:56 +00:00
Adw.ViewStackPage {
name: "explore";
title: _("Explore");
icon-name: "web-browser-symbolic";
2022-08-24 15:25:24 +00:00
child: Gtk.ScrolledWindow {
Adw.StatusPage {
title: _("Search for presets");
description: _("Enter a keyword to search on <a href=\"https://gradienceteam.github.io/presets\">GradienceTeam/Community</a>.");
2022-08-24 15:25:24 +00:00
valign: start;
Adw.Clamp {
styles ["clamp"]
Gtk.Box {
orientation: vertical;
Gtk.SearchEntry search_entry {
hexpand: true;
placeholder-text: _("e.g. \"Pretty Purple\"");
}
2022-08-24 15:25:24 +00:00
Gtk.Stack search_stack {
Gtk.StackPage {
name: "page_spinner";
child: Gtk.Spinner search_spinner {
2022-08-24 15:25:24 +00:00
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: Gtk.Label {
label: _("No Results Found");
valign: start;
halign: center;
};
}
2022-08-25 10:24:20 +00:00
Gtk.StackPage {
name: "page_offline";
child: Gtk.Label {
2022-08-25 10:24:20 +00:00
label: _("Offline");
valign: start;
halign: center;
};
}
2022-08-24 15:25:24 +00:00
}
}
}
}
};
2022-08-15 13:40:21 +00:00
}
2022-09-03 11:02:36 +00:00
Adw.ViewStackPage {
name: "repos";
title: _("Repositories");
icon-name: "folder-symbolic";
child: Adw.PreferencesPage repos { };
}
2022-08-22 13:21:56 +00:00
}
Adw.ViewSwitcherBar {
stack: view_stack;
reveal: bind title.title-visible;
}
2022-08-15 13:40:21 +00:00
}
2022-08-22 13:21:56 +00:00
}
2022-08-15 13:40:21 +00:00
}
2022-08-22 13:21:56 +00:00
}
2022-08-20 02:07:31 +00:00
}
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"]
}