[gnome-builder] greeter: move button bar to action bar



commit 13590aa1cf4524a12e5dbd685606d64a050badd0
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 21 18:55:33 2019 -0800

    greeter: move button bar to action bar

 src/libide/greeter/ide-greeter-buttons-section.c | 37 ++++--------------------
 src/libide/greeter/ide-greeter-row.ui            |  2 ++
 src/libide/greeter/ide-greeter-workspace.c       |  2 +-
 src/libide/greeter/ide-greeter-workspace.ui      | 16 ++++++----
 4 files changed, 20 insertions(+), 37 deletions(-)
---
diff --git a/src/libide/greeter/ide-greeter-buttons-section.c 
b/src/libide/greeter/ide-greeter-buttons-section.c
index 4778024b3..c70c1c5a2 100644
--- a/src/libide/greeter/ide-greeter-buttons-section.c
+++ b/src/libide/greeter/ide-greeter-buttons-section.c
@@ -43,41 +43,18 @@ ide_greeter_buttons_section_class_init (IdeGreeterButtonsSectionClass *klass)
 static void
 ide_greeter_buttons_section_init (IdeGreeterButtonsSection *self)
 {
-  PangoAttrList *attrs;
-  GtkBox *vbox;
-  GtkLabel *label;
-
-  g_object_set (self,
-                "width-request", 600,
-                "halign", GTK_ALIGN_CENTER,
-                NULL);
-
-  attrs = pango_attr_list_new ();
-  pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
-
-  vbox = g_object_new (GTK_TYPE_BOX,
-                       "orientation", GTK_ORIENTATION_VERTICAL,
-                       "spacing", 6,
-                       "visible", TRUE,
-                       NULL);
-  gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (vbox));
-
-  label = g_object_new (GTK_TYPE_LABEL,
-                        "attributes", attrs,
-                        "xalign", 0.0f,
-                        "label", _("Add a Project"),
-                        "visible", TRUE,
-                        NULL);
-  dzl_gtk_widget_add_style_class (GTK_WIDGET (label), "dim-label");
-  gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (label));
-
   self->box = g_object_new (DZL_TYPE_PRIORITY_BOX,
+                            "margin-bottom", 6,
+                            "margin-top", 6,
                             "orientation", GTK_ORIENTATION_HORIZONTAL,
                             "homogeneous", TRUE,
+                            "halign", GTK_ALIGN_CENTER,
+                            "hexpand", TRUE,
                             "spacing", 12,
+                            "width-request", 600,
                             "visible", TRUE,
                             NULL);
-  gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (self->box));
+  gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->box));
 
   ide_greeter_buttons_section_add_button (self,
                                           0,
@@ -94,8 +71,6 @@ ide_greeter_buttons_section_init (IdeGreeterButtonsSection *self)
                                                         "action-name", "win.surface",
                                                         "action-target", g_variant_new_string ("clone"),
                                                         NULL));
-
-  g_clear_pointer (&attrs, pango_attr_list_unref);
 }
 
 void
diff --git a/src/libide/greeter/ide-greeter-row.ui b/src/libide/greeter/ide-greeter-row.ui
index 6790db95f..b92de908e 100644
--- a/src/libide/greeter/ide-greeter-row.ui
+++ b/src/libide/greeter/ide-greeter-row.ui
@@ -27,6 +27,7 @@
             <property name="visible">true</property>
             <child>
               <object class="GtkLabel" id="title">
+                <property name="ellipsize">end</property>
                 <property name="visible">true</property>
                 <property name="xalign">0.0</property>
                 <attributes>
@@ -36,6 +37,7 @@
             </child>
             <child>
               <object class="GtkLabel" id="subtitle">
+                <property name="ellipsize">end</property>
                 <property name="visible">true</property>
                 <property name="xalign">0.0</property>
                 <style>
diff --git a/src/libide/greeter/ide-greeter-workspace.c b/src/libide/greeter/ide-greeter-workspace.c
index 46d135374..41e23547d 100644
--- a/src/libide/greeter/ide-greeter-workspace.c
+++ b/src/libide/greeter/ide-greeter-workspace.c
@@ -587,8 +587,8 @@ ide_greeter_workspace_class_init (IdeGreeterWorkspaceClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/builder/ui/ide-greeter-workspace.ui");
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, action_bar);
-  gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, back_button);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, buttons_section);
+  gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, back_button);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, clone_surface);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, header_bar);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, left_box);
diff --git a/src/libide/greeter/ide-greeter-workspace.ui b/src/libide/greeter/ide-greeter-workspace.ui
index 695f01eb8..a7cb7c448 100644
--- a/src/libide/greeter/ide-greeter-workspace.ui
+++ b/src/libide/greeter/ide-greeter-workspace.ui
@@ -109,11 +109,6 @@
                                 <property name="orientation">vertical</property>
                                 <property name="spacing">32</property>
                                 <property name="visible">true</property>
-                                <child>
-                                  <object class="IdeGreeterButtonsSection" id="buttons_section">
-                                    <property name="visible">true</property>
-                                  </object>
-                                </child>
                               </object>
                             </child>
                           </object>
@@ -122,6 +117,17 @@
                     </child>
                   </object>
                 </child>
+                <child>
+                  <object class="GtkActionBar" id="project_action_bar">
+                    <property name="visible">true</property>
+                    <child>
+                      <object class="IdeGreeterButtonsSection" id="buttons_section">
+                        <property name="halign">center</property>
+                        <property name="visible">true</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
                 <child>
                   <object class="GtkActionBar" id="action_bar">
                     <child>


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