[gnome-builder/wip/project-selector: 22/67] initial-setup: focus work and header lines



commit 3753edc3495a754db450403cc974c493ff88722f
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 1 23:34:50 2015 -0700

    initial-setup: focus work and header lines

 data/ui/gb-initial-setup-dialog.ui          |    7 ++++-
 src/initial-setup/gb-initial-setup-dialog.c |   30 ++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/gb-initial-setup-dialog.ui b/data/ui/gb-initial-setup-dialog.ui
index 9e19efe..39da3d9 100644
--- a/data/ui/gb-initial-setup-dialog.ui
+++ b/data/ui/gb-initial-setup-dialog.ui
@@ -65,7 +65,8 @@
                                 <property name="visible">true</property>
                                 <child>
                                   <object class="GtkLabel">
-                                    <property name="label" translatable="yes">New Project</property>
+                                    <property name="label" translatable="yes">_New Project</property>
+                                    <property name="use-underline">true</property>
                                     <property name="hexpand">true</property>
                                     <property name="visible">true</property>
                                     <property name="xalign">0.0</property>
@@ -95,7 +96,8 @@
                                 <property name="visible">true</property>
                                 <child>
                                   <object class="GtkLabel">
-                                    <property name="label" translatable="yes">Open Project</property>
+                                    <property name="label" translatable="yes">_Open Project</property>
+                                    <property name="use-underline">true</property>
                                     <property name="hexpand">true</property>
                                     <property name="visible">true</property>
                                     <property name="xalign">0.0</property>
@@ -119,6 +121,7 @@
                           <object class="GtkListBoxRow" id="row_recent_projects">
                             <property name="visible">true</property>
                             <property name="activatable">false</property>
+                            <property name="can-focus">false</property>
                             <property name="selectable">false</property>
                             <child>
                               <object class="GtkBox">
diff --git a/src/initial-setup/gb-initial-setup-dialog.c b/src/initial-setup/gb-initial-setup-dialog.c
index c97e673..1501145 100644
--- a/src/initial-setup/gb-initial-setup-dialog.c
+++ b/src/initial-setup/gb-initial-setup-dialog.c
@@ -116,6 +116,29 @@ gb_initial_setup_dialog_show_more (GbInitialSetupDialog *self)
 }
 
 static void
+gb_initial_setup_dialog__select_list_box_header_func (GtkListBoxRow *row,
+                                                      GtkListBoxRow *before,
+                                                      gpointer       user_data)
+{
+  GbInitialSetupDialog *self = user_data;
+
+  g_assert (GB_IS_INITIAL_SETUP_DIALOG (self));
+  g_assert (GTK_IS_LIST_BOX_ROW (row));
+  g_assert (!before || GTK_IS_LIST_BOX_ROW (before));
+
+  if (before != NULL)
+    {
+      GtkWidget *header;
+
+      header = g_object_new (GTK_TYPE_SEPARATOR,
+                             "orientation", GTK_ORIENTATION_HORIZONTAL,
+                             "visible", TRUE,
+                             NULL);
+      gtk_list_box_row_set_header (row, header);
+    }
+}
+
+static void
 gb_initial_setup_dialog__select_list_box_row_activated (GbInitialSetupDialog *self,
                                                         GtkListBoxRow        *row,
                                                         GtkListBox           *list_box)
@@ -229,7 +252,10 @@ gb_initial_setup_dialog_init (GbInitialSetupDialog *self)
 {
   gtk_widget_init_template (GTK_WIDGET (self));
 
-  gb_initial_setup_dialog_set_page (self, GB_INITIAL_SETUP_PAGE_SELECT_PROJECT);
+  gtk_list_box_set_header_func (self->select_list_box,
+                                gb_initial_setup_dialog__select_list_box_header_func,
+                                self,
+                                NULL);
 
   g_signal_connect_object (self->back_button,
                            "clicked",
@@ -242,6 +268,8 @@ gb_initial_setup_dialog_init (GbInitialSetupDialog *self)
                            G_CALLBACK (gb_initial_setup_dialog__select_list_box_row_activated),
                            self,
                            G_CONNECT_SWAPPED);
+
+  gb_initial_setup_dialog_set_page (self, GB_INITIAL_SETUP_PAGE_SELECT_PROJECT);
 }
 
 GType


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