[gnome-tweak-tool/wip/pwood/app-chooser: 5/11] AppChooser: Add a default response



commit 48740ed54008a5cc19a17b5a23a803965d51e98e
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Fri Mar 27 11:04:00 2015 +0000

    AppChooser: Add a default response
    
    Adding a default response improves the keyboard navigation as the user
    can select an application by pressing ‘Enter’. It also changes the style
    of the ‘Add Application’ button.
    
    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 b1f58c5..3dc803d 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -43,6 +43,7 @@ class _AppChooser(Gtk.Dialog):
         self.entry = Gtk.SearchEntry(
                 placeholder_text=_("Search Applications..."))
         self.entry.set_width_chars(30)
+        self.entry.props.activates_default=True
 
         self.searchbar = Gtk.SearchBar()
         self.searchbar.add(self.entry)
@@ -76,6 +77,7 @@ class _AppChooser(Gtk.Dialog):
 
         self.add_button(_("_Close"), Gtk.ResponseType.CLOSE)
         self.add_button(_("Add Application"), Gtk.ResponseType.OK)
+        self.set_default_response(Gtk.ResponseType.OK)
 
         self.get_content_area().pack_start(self.searchbar, False, False, 0)
         self.get_content_area().pack_start(sw, True, True, 0)


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