[gnome-builder] greeter: tweak action bar usage for greeter workspace



commit 43173feb58c834ee0ced13b27a00e301c986be8c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 21 19:04:28 2019 -0800

    greeter: tweak action bar usage for greeter workspace

 src/libide/greeter/ide-greeter-workspace.c  |  7 ++--
 src/libide/greeter/ide-greeter-workspace.ui | 55 +++++++++++++++++------------
 2 files changed, 38 insertions(+), 24 deletions(-)
---
diff --git a/src/libide/greeter/ide-greeter-workspace.c b/src/libide/greeter/ide-greeter-workspace.c
index 41e23547d..403c8f750 100644
--- a/src/libide/greeter/ide-greeter-workspace.c
+++ b/src/libide/greeter/ide-greeter-workspace.c
@@ -65,6 +65,7 @@ struct _IdeGreeterWorkspace
   GtkButton                *back_button;
   GtkButton                *select_button;
   GtkActionBar             *action_bar;
+  GtkActionBar             *projects_action_bar;
   GtkLabel                 *title;
   IdeGreeterButtonsSection *buttons_section;
 
@@ -587,15 +588,16 @@ 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, buttons_section);
   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, clone_surface);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, header_bar);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, left_box);
+  gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, projects_action_bar);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, search_entry);
+  gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, sections);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, select_button);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, surfaces);
-  gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, sections);
   gtk_widget_class_bind_template_child (widget_class, IdeGreeterWorkspace, title);
   gtk_widget_class_bind_template_callback (widget_class, stack_notify_visible_child_cb);
 
@@ -807,6 +809,7 @@ ide_greeter_workspace_set_selection_mode (IdeGreeterWorkspace *self,
                              ide_greeter_workspace_set_selection_mode_cb,
                              GINT_TO_POINTER (selection_mode));
       gtk_widget_set_visible (GTK_WIDGET (self->action_bar), selection_mode);
+      gtk_widget_set_visible (GTK_WIDGET (self->projects_action_bar), !selection_mode);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SELECTION_MODE]);
     }
 }
diff --git a/src/libide/greeter/ide-greeter-workspace.ui b/src/libide/greeter/ide-greeter-workspace.ui
index a7cb7c448..f5753b769 100644
--- a/src/libide/greeter/ide-greeter-workspace.ui
+++ b/src/libide/greeter/ide-greeter-workspace.ui
@@ -118,7 +118,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkActionBar" id="project_action_bar">
+                  <object class="GtkActionBar" id="projects_action_bar">
                     <property name="visible">true</property>
                     <child>
                       <object class="IdeGreeterButtonsSection" id="buttons_section">
@@ -130,28 +130,39 @@
                 </child>
                 <child>
                   <object class="GtkActionBar" id="action_bar">
-                    <child>
-                      <object class="GtkButton" id="remove_button">
-                        <property name="action-name">win.delete-selected-rows</property>
-                        <property name="label" translatable="yes">_Remove Projects</property>
-                        <property name="use-underline">true</property>
+                    <child type="center">
+                      <object class="GtkBox">
+                        <property name="width-request">600</property>
+                        <property name="orientation">horizontal</property>
+                        <property name="homogeneous">true</property>
+                        <property name="margin-bottom">6</property>
+                        <property name="margin-top">6</property>
+                        <property name="spacing">10</property>
                         <property name="visible">true</property>
-                        <property name="sensitive">false</property>
-                        <style>
-                          <class name="destructive-action"/>
-                        </style>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="purge_button">
-                        <property name="action-name">win.purge-selected-rows</property>
-                        <property name="label" translatable="yes">Remove Projects and Sources…</property>
-                        <property name="use-underline">true</property>
-                        <property name="visible">true</property>
-                        <property name="sensitive">false</property>
-                        <style>
-                          <class name="destructive-action"/>
-                        </style>
+                        <child>
+                          <object class="GtkButton" id="remove_button">
+                            <property name="action-name">win.delete-selected-rows</property>
+                            <property name="label" translatable="yes">_Remove Projects</property>
+                            <property name="use-underline">true</property>
+                            <property name="visible">true</property>
+                            <property name="sensitive">false</property>
+                            <style>
+                              <class name="destructive-action"/>
+                            </style>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="purge_button">
+                            <property name="action-name">win.purge-selected-rows</property>
+                            <property name="label" translatable="yes">Remove Projects and Sources…</property>
+                            <property name="use-underline">true</property>
+                            <property name="visible">true</property>
+                            <property name="sensitive">false</property>
+                            <style>
+                              <class name="destructive-action"/>
+                            </style>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>


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