UI: disable preset preview MenuButton

This also incudes removing some leftover code that was used for this MenuButton.

Fixes #670
This commit is contained in:
tfuxu 2023-01-04 21:24:54 +01:00
parent 8df722ef1a
commit caacb24fae
No known key found for this signature in database
GPG key ID: 79CFC3B9B31C098A
2 changed files with 4 additions and 58 deletions

View file

@ -30,11 +30,12 @@ template GradienceMainWindow : Adw.ApplicationWindow {
tooltip-text: _("Apply Preset");
action-name: "app.apply_color_scheme";
}
[start]
Gtk.MenuButton {
Button {
icon-name: "applications-science-symbolic";
menu-model: preview-menu;
tooltip-text: _("Preview Theme in…");
tooltip-text: _("Show Preview Window");
visible: false;
}
[title]
@ -143,25 +144,6 @@ menu main-menu {
}
}
menu preview-menu {
section {
item {
label: _("Adwaita Demo");
action: "app.show_adwaita_demo";
}
item {
label: _("GTK 4 Demo");
action: "app.show_gtk4_demo";
}
item {
label: _("GTK 4 Widget Factory");
action: "app.show_gtk4_widget_factory";
}
}
}
menu presets-menu {
section {
label: _("Built-In Presets");

View file

@ -127,15 +127,6 @@ class GradienceApplication(Adw.Application):
self.actions.create_action("apply_color_scheme",
self.show_apply_color_scheme_dialog)
self.actions.create_action("show_adwaita_demo",
self.show_adwaita_demo)
self.actions.create_action("show_gtk4_widget_factory",
self.show_gtk4_widget_factory)
self.actions.create_action("show_gtk4_demo",
self.show_gtk4_demo)
self.actions.create_action("restore_color_scheme",
self.show_restore_color_scheme_dialog)
@ -719,33 +710,6 @@ class GradienceApplication(Adw.Application):
self.props.active_window.update_errors(
self.global_errors + plugins_errors)
@staticmethod
def show_adwaita_demo(*_args):
try:
GLib.spawn_command_line_async(
"/bin/adwaita-1-demo > /dev/null 2>&1"
)
except GLib.GError as e:
logging.error("An error occurred while trying to execute external program.", exc=e)
@staticmethod
def show_gtk4_demo(*_args):
try:
GLib.spawn_command_line_async(
"/bin/gtk4-demo > /dev/null 2>&1"
)
except GLib.GError as e:
logging.error("An error occurred while trying to execute external program.", exc=e)
@staticmethod
def show_gtk4_widget_factory(*_args):
try:
GLib.spawn_command_line_async(
"/bin/gtk4-widget-factory > /dev/null 2>&1"
)
except GLib.GError as e:
logging.error("An error occurred while trying to execute external program.", exc=e)
def main():
"""The application's entry point."""