From: Christian Heller Date: Thu, 12 Sep 2024 19:04:27 +0000 (+0200) Subject: In browser.py, allow activating sort order by hitting Return. X-Git-Url: https://plomlompom.com/repos/pick_tasks?a=commitdiff_plain;h=1550c2060e2c0f506ff9931a3fbad3fb5877e1b5;p=stable_plom In browser.py, allow activating sort order by hitting Return. --- diff --git a/browser.py b/browser.py index c8f4bf8..7639a0f 100755 --- a/browser.py +++ b/browser.py @@ -281,7 +281,8 @@ class MainWindow(Gtk.Window): viewer.append(self.navbar) viewer.append(init_gallery_widgets()) self.side_box = Gtk.Box(orientation=OR_V) - self.side_box.append(init_sorter_and_filterer()) + self.sort_box = init_sorter_and_filterer() + self.side_box.append(self.sort_box) self.side_box.append(init_metadata_box()) box_outer = Gtk.Box(orientation=OR_H) box_outer.append(self.side_box) @@ -730,7 +731,10 @@ class MainWindow(Gtk.Window): """Handle keys if not in Entry, return True if key handling done.""" if isinstance(self.get_focus().get_parent(), Gtk.Entry): return False - if Gdk.KEY_G == keyval: + if Gdk.KEY_Return == keyval and\ + self.get_focus().get_parent().get_parent() == self.sort_box: + self.activate_sort_order() + elif Gdk.KEY_G == keyval: self.move_selection_in_gallery(None, None, 1) elif Gdk.KEY_h == keyval: self.move_selection_in_gallery(-1, None, None)