From b5518e504257890fe178432f7cfe931240f6ff81 Mon Sep 17 00:00:00 2001 From: heliguy Date: Sun, 31 Mar 2024 01:37:03 -0400 Subject: [PATCH] Do not use overlay for downgrade apply button --- data/ui/downgrade.blp | 112 ++++++++++++++++++++-------------------- src/downgrade_window.py | 3 +- 2 files changed, 59 insertions(+), 56 deletions(-) diff --git a/data/ui/downgrade.blp b/data/ui/downgrade.blp index 8522378..9454a82 100644 --- a/data/ui/downgrade.blp +++ b/data/ui/downgrade.blp @@ -10,70 +10,72 @@ template $DowngradeWindow: Adw.Dialog { Adw.HeaderBar header_bar { } - content: Adw.ToastOverlay toast_overlay { - Overlay { - [overlay] - Button apply_button { - visible: false; - valign: end; - halign: center; - margin-bottom: 12; - sensitive: false; - Adw.ButtonContent { - label: _("Downgrade"); - icon-name: "arrow-turn-left-down-symbolic"; - } + [bottom] + ActionBar action_bar { + revealed: false; - styles [ - "suggested-action", - "pill" - ] + [center] + Button apply_button { + visible: false; + valign: end; + halign: center; + margin-top: 6; + margin-bottom: 6; + Adw.ButtonContent { + label: _("Downgrade"); + icon-name: "arrow-turn-left-down-symbolic"; } - Stack main_stack { - Box loading { - orientation: vertical; - spacing: 10; - margin-top: 40; - margin-bottom: 20; - halign: center; - valign: center; + styles [ + "suggested-action", + "pill" + ] + } + } - Spinner { - margin-bottom: 35; - width-request: 30; - height-request: 30; - opacity: 0.5; - spinning: true; - } + content: Adw.ToastOverlay toast_overlay { + Stack main_stack { + Box loading { + orientation: vertical; + spacing: 10; + margin-top: 40; + margin-bottom: 20; + halign: center; + valign: center; - Label loading_label { - label: _("Fetching Releases"); - styles [ - "title-1", - "title" - ] - } + Spinner { + margin-bottom: 35; + width-request: 30; + height-request: 30; + opacity: 0.5; + spinning: true; + } - Label { - label: _("This could take a while"); - styles ["description", "body"] + Label loading_label { + label: _("Fetching Releases"); + styles [ + "title-1", + "title" + ] + } + + Label { + label: _("This could take a while"); + styles ["description", "body"] + } + } + + Adw.PreferencesPage outerbox { + Adw.PreferencesGroup { + Adw.SwitchRow mask_row { + title: _("Disable Updates"); + active: true; } } - Adw.PreferencesPage outerbox { - Adw.PreferencesGroup { - Adw.SwitchRow mask_row { - title: _("Disable Updates"); - active: true; - } - } - - Adw.PreferencesGroup versions_group { - title: _("Select a Release"); - description: _("This will uninstall the current release and install the chosen one instead. Note that downgrading can cause issues."); - margin-bottom: 42; - } + Adw.PreferencesGroup versions_group { + title: _("Select a Release"); + description: _("This will uninstall the current release and install the chosen one instead. Note that downgrading can cause issues."); } } } diff --git a/src/downgrade_window.py b/src/downgrade_window.py index 3301c0a..a0841c7 100644 --- a/src/downgrade_window.py +++ b/src/downgrade_window.py @@ -21,9 +21,10 @@ class DowngradeWindow(Adw.Dialog): loading_label = Gtk.Template.Child() main_stack = Gtk.Template.Child() outerbox = Gtk.Template.Child() + action_bar = Gtk.Template.Child() def selection_handler(self, button, index): - self.apply_button.set_sensitive(True) + self.action_bar.set_revealed(True) if button.get_active(): self.commit_to_use = self.versions[index][0]