diff --git a/data/ui/search_install.blp b/data/ui/search_install.blp index fb08468..7d06b35 100644 --- a/data/ui/search_install.blp +++ b/data/ui/search_install.blp @@ -15,7 +15,7 @@ template $SearchInstallWindow: Adw.Dialog { Adw.ToastOverlay toast_overlay { Adw.ToolbarView { [top] - HeaderBar { + Adw.HeaderBar { } content: Adw.StatusPage { @@ -36,12 +36,7 @@ template $SearchInstallWindow: Adw.Dialog { title: _("Results"); Adw.ToolbarView { [top] - HeaderBar { - [start] - Button back_button { - tooltip-text: _("Back"); - icon-name: "left-large-symbolic"; - } + Adw.HeaderBar { } [bottom] ActionBar action_bar { @@ -146,7 +141,7 @@ template $SearchInstallWindow: Adw.Dialog { } Adw.ToolbarView installing { [top] - HeaderBar { + Adw.HeaderBar { } content: Overlay overlay { diff --git a/src/search_install_window.py b/src/search_install_window.py index 93617c7..3ee0b4f 100644 --- a/src/search_install_window.py +++ b/src/search_install_window.py @@ -54,7 +54,6 @@ class ResultRow(Adw.ActionRow): class SearchInstallWindow(Adw.Dialog): __gtype_name__ = "SearchInstallWindow" - back_button = Gtk.Template.Child() nav_view = Gtk.Template.Child() search_page = Gtk.Template.Child() results_page = Gtk.Template.Child() @@ -77,12 +76,6 @@ class SearchInstallWindow(Adw.Dialog): toast_overlay = Gtk.Template.Child() progress_bar = Gtk.Template.Child() - def key_handler(self, controller, keyval, keycode, state): - if keyval == Gdk.KEY_Escape or ( - keyval == Gdk.KEY_w and state == Gdk.ModifierType.CONTROL_MASK - ): - self.close() - def reset(self): self.results = [] self.results_list.remove_all() @@ -107,14 +100,9 @@ class SearchInstallWindow(Adw.Dialog): total += 1 if total < 2: self.nav_view.push(self.results_page) - self.back_button.set_visible(False) - self.back_button.set_sensitive(False) + self.results_page.set_can_pop(False) self.search_remote = self.host_remotes[0][0] self.install_type = self.host_remotes[0][7] - self.nav_view.connect( - "popped", lambda *_: self.nav_view.push(self.results_page) - ) - self.nav_view.set_animate_transitions(False) if self.host_remotes[0][1] == "-": self.title = _("Search {}").format(self.host_remotes[0][0]) @@ -245,8 +233,6 @@ class SearchInstallWindow(Adw.Dialog): self.my_utils = myUtils(self) self.new_env = dict(os.environ) self.new_env["LC_ALL"] = "C" - event_controller = Gtk.EventControllerKey() - event_controller.connect("key-pressed", self.key_handler) self.host_remotes = self.my_utils.get_host_remotes() self.parent_window = parent_window self.results = [] @@ -255,12 +241,10 @@ class SearchInstallWindow(Adw.Dialog): self.install_type = "" self.title = _("Install From The Web") - self.back_button.connect("clicked", lambda *_: self.nav_view.pop()) self.canel_search = Gio.Cancellable() self.search_entry.connect("activate", self.search_handler) self.search_button.connect("clicked", self.search_handler) self.install_button.connect("clicked", self.install_handler) # Apply Widgets - self.add_controller(event_controller) self.generate_remotes_list() \ No newline at end of file