home · contact · privacy
Browser: Fix click on sorter not expanding values list.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 25 Sep 2024 06:02:53 +0000 (08:02 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 25 Sep 2024 06:02:53 +0000 (08:02 +0200)
browser.py

index 858fa8d5b3276d53031026eda406ebe77c8ec56e..ecbe83141e29a82a8dd8a792b57113aef53e6001 100755 (executable)
@@ -638,7 +638,6 @@ class MainWindow(Gtk.Window):
                     self.sort_order_last_selected.get_last_child().hide()
                 list_item = self.sort_selection.props.selected_item.widget
                 list_item.get_parent().grab_focus()
-                list_item.get_last_child().show()
                 self.sort_order_last_selected = list_item
 
             self.sort_order_last_selected = None
@@ -648,10 +647,11 @@ class MainWindow(Gtk.Window):
             factory = Gtk.SignalListItemFactory()
             factory.connect('setup', setup_sort_order_item)
             factory.connect('bind', bind_sort_order_item)
-            selector = Gtk.ListView(model=self.sort_selection, factory=factory)
+            self.sort_list_view = Gtk.ListView(model=self.sort_selection,
+                                               factory=factory)
             sort_box = Gtk.Box(orientation=OR_V)
             sort_box.append(Gtk.Label(label='** sort order **'))
-            sort_box.append(selector)
+            sort_box.append(self.sort_list_view)
             self.btn_activate_sort = Gtk.Button(label='activate')
             self.btn_activate_sort.props.sensitive = False
             self.btn_activate_sort.connect(
@@ -719,6 +719,8 @@ class MainWindow(Gtk.Window):
         focused = self.get_focus()
         if isinstance(focused, GallerySlot):
             self.gallery.on_focus_slot(focused)
+        elif focused.get_parent() == self.sort_list_view:
+            focused.get_first_child().get_last_child().show()
 
     def on_resize(self):
         """On window resize, do .gallery.on_resize towards its new geometry."""