[gtk+/wip/matthiasc/filechooser] file chooser: Improve keynav



commit e277d66cdc30195a9ba9e21c8e9b92320bf1fddb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 27 12:23:48 2015 -0400

    file chooser: Improve keynav
    
    Some internal containers were erroneously taking focus, interrupting
    the flow of tab keynav, and using arrow keynav to go from the file
    list to the sidebar did not work anymore, after the recent sidebar
    rewrite.

 gtk/gtkfilechooserwidget.c     |    4 ++--
 gtk/ui/gtkfilechooserwidget.ui |    8 +-------
 2 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 6e45554..bb3c656 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1227,8 +1227,8 @@ browse_files_key_press_event_cb (GtkWidget   *widget,
 
   if (key_is_left_or_right (event))
     {
-      gtk_widget_grab_focus (priv->places_sidebar);
-      return TRUE;
+      if (gtk_widget_child_focus (priv->places_sidebar, GTK_DIR_LEFT))
+        return TRUE;
     }
 
   if ((event->keyval == GDK_KEY_Return
diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui
index 5e1ffee..f38ca1c 100644
--- a/gtk/ui/gtkfilechooserwidget.ui
+++ b/gtk/ui/gtkfilechooserwidget.ui
@@ -11,11 +11,10 @@
         <child>
           <object class="GtkPaned" id="browse_widgets_hpaned">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
             <child>
               <object class="GtkPlacesSidebar" id="places_sidebar">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="can_focus">False</property>
                 <property name="hscrollbar_policy">never</property>
                 <property name="local_only">True</property>
                 <property name="show_enter_location">True</property>
@@ -50,7 +49,6 @@
                         <child>
                           <object class="GtkStack" id="browse_header_stack">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
                             <property name="transition-type">crossfade</property>
                             <child>
                               <object class="GtkBox">
@@ -60,7 +58,6 @@
                                 <child>
                                   <object class="GtkPathBar" id="browse_path_bar">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <signal name="path-clicked" handler="path_bar_clicked" after="yes" 
swapped="no"/>
                                   </object>
                                   <packing>
@@ -70,7 +67,6 @@
                                 <child>
                                   <object class="GtkMenuButton" id="browse_new_folder_button">
                                     <property name="tooltip-text" translatable="yes">Create Folder</property>
-                                    <property name="can_focus">True</property>
                                     <property name="use_underline">True</property>
                                     <property name="popover">new_folder_popover</property>
                                     <signal name="notify::active" handler="new_folder_popover_active"/>
@@ -167,12 +163,10 @@
                         <child>
                           <object class="GtkScrolledWindow" id="browse_files_swin">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
                             <property name="hscrollbar_policy">never</property>
                             <child>
                               <object class="GtkTreeView" id="browse_files_tree_view">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
                                 <property name="has_tooltip">True</property>
                                 <property name="enable-search">False</property>
                                 <child internal-child="accessible">


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