[gnome-tweak-tool/gnome-3-16] AppChooser: Select app when row is activated



commit 9eea75156db3185ce2af43519a104372007cf891
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Wed Apr 1 18:35:12 2015 +0100

    AppChooser: Select app when row is activated
    
    This allows the user to select a startup application by double clicking
    on it rather than having to select it and then click on the ‘Add
    Application’ button. If there are now rows visible then GtkListBox will
    activate the (hidden) selected row so we need to check that the
    activated row is mapped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747983

 gtweak/tweaks/tweak_group_startup.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_startup.py b/gtweak/tweaks/tweak_group_startup.py
index 2862ee3..634612f 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -48,10 +48,12 @@ class _AppChooser(Gtk.Dialog):
 
         lb = Gtk.ListBox()
         lb.props.margin = 5
+        lb.props.activate_on_single_click = False
         lb.set_sort_func(self._sort_apps, None)
         lb.set_header_func(_list_header_func, None)
         lb.set_filter_func(self._list_filter_func, None)
         self.entry.connect("search-changed", self._on_search_entry_changed)
+        lb.connect("row-activated", lambda b, r: self.response(Gtk.ResponseType.OK) if r.get_mapped() else 
None)
         lb.connect("row-selected", self._on_row_selected)
 
         apps = Gio.app_info_get_all()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]