Gradience/data/ui/presets_manager_window.blp
2022-09-27 00:03:53 +02:00

172 lines
4.5 KiB
Text

using Gtk 4.0;
using Adw 1;
template GradiencePresetWindow : Adw.Window {
title: _("Presets");
default-width: 700;
default-height: 550;
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;
[start]
Button import_button {
styles ["suggested-action"]
label: _("Import");
clicked => on_import_button_clicked();
}
[start]
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://gradienceteam.github.io/presets\">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");
};
}
}
}
}
}
};
}
Adw.ViewStackPage {
name: "repos";
title: _("Repositories");
icon-name: "folder-symbolic";
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"]
}