[gnome-builder] editor: start on new document button



commit 7baad9dfdbad74bfc8f5891416e56d2b6ab8dd6d
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jul 9 02:44:46 2017 -0700

    editor: start on new document button
    
    Now that all the features are in Dazzle for this, we can simplify things
    here. We still have a bunch of style tweaks to do, for example, the
    design calls for the button to be closer to the perpsectives button.
    
    Also, the styling of the menu is still a bit off.

 libide/editor/ide-editor-workbench-addin.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libide/editor/ide-editor-workbench-addin.c b/libide/editor/ide-editor-workbench-addin.c
index dd9e191..66631f0 100644
--- a/libide/editor/ide-editor-workbench-addin.c
+++ b/libide/editor/ide-editor-workbench-addin.c
@@ -47,6 +47,7 @@ struct _IdeEditorWorkbenchAddin
   IdeWorkbench         *workbench;
   IdeEditorPerspective *perspective;
   GtkBox               *panels_box;
+  DzlMenuButton        *new_button;
 };
 
 typedef struct
@@ -208,6 +209,20 @@ ide_editor_workbench_addin_load (IdeWorkbenchAddin *addin,
                     G_CALLBACK (gtk_widget_destroyed),
                     &self->perspective);
   ide_workbench_add_perspective (workbench, IDE_PERSPECTIVE (self->perspective));
+
+  self->new_button = g_object_new (DZL_TYPE_MENU_BUTTON,
+                                   "icon-name", "document-new-symbolic",
+                                   "show-arrow", TRUE,
+                                   "show-icons", FALSE,
+                                   "show-accels", FALSE,
+                                   "menu-id", "new-document-menu",
+                                   "visible", TRUE,
+                                   NULL);
+  g_signal_connect (self->new_button,
+                    "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);
 }
 
 static void


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