[gnome-builder/wip/chergert/layout] editor: the new button belongs in the primary box



commit ad7370caaca800c71659ad8cf7600337292195be
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 10 01:51:04 2017 -0700

    editor: the new button belongs in the primary box
    
    According to the mockups, this button belongs near the
    perspective selector with alternate spacing from the normal
    groupings.

 libide/editor/ide-editor-workbench-addin.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libide/editor/ide-editor-workbench-addin.c b/libide/editor/ide-editor-workbench-addin.c
index 44225f7..154ee43 100644
--- a/libide/editor/ide-editor-workbench-addin.c
+++ b/libide/editor/ide-editor-workbench-addin.c
@@ -174,6 +174,7 @@ ide_editor_workbench_addin_add_buttons (IdeEditorWorkbenchAddin *self,
 
   self->new_button = g_object_new (DZL_TYPE_MENU_BUTTON,
                                    "icon-name", "document-new-symbolic",
+                                   "focus-on-click", FALSE,
                                    "show-arrow", TRUE,
                                    "show-icons", FALSE,
                                    "show-accels", FALSE,
@@ -184,7 +185,7 @@ ide_editor_workbench_addin_add_buttons (IdeEditorWorkbenchAddin *self,
                     "destroy",
                     G_CALLBACK (gtk_widget_destroyed),
                     &self->new_button);
-  ide_workbench_header_bar_insert_left (header, GTK_WIDGET (self->new_button), GTK_PACK_START, 5);
+  ide_workbench_header_bar_add_primary (header, GTK_WIDGET (self->new_button));
 }
 
 static void
@@ -429,6 +430,8 @@ ide_editor_workbench_addin_perspective_set (IdeWorkbenchAddin *addin,
 
   gtk_widget_set_visible (GTK_WIDGET (self->panels_box),
                           IDE_IS_EDITOR_PERSPECTIVE (perspective));
+  gtk_widget_set_visible (GTK_WIDGET (self->new_button),
+                          IDE_IS_EDITOR_PERSPECTIVE (perspective));
 }
 
 static void


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