home · contact · privacy
In browser.py, allow activating sort order by hitting Return.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 12 Sep 2024 19:04:27 +0000 (21:04 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 12 Sep 2024 19:04:27 +0000 (21:04 +0200)
browser.py

index c8f4bf8227e471afdc346a6dcf112e0ac5a0a495..7639a0f720c7a185e63f1ef22cd82daceffc41ce 100755 (executable)
@@ -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)