[gnome-builder] addins: use ide_workbench_get_headerbar()



commit ef2a1ffc051ba9c628b056b19c47c7449608856e
Author: Christian Hergert <christian hergert me>
Date:   Fri Jun 24 20:15:28 2016 -0700

    addins: use ide_workbench_get_headerbar()
    
    Rather than casting what they get back, this is safe in case the current
    perspective is not what they expect.

 libide/editor/ide-editor-workbench-addin.c      |    2 +-
 plugins/build-tools/gbp-build-workbench-addin.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libide/editor/ide-editor-workbench-addin.c b/libide/editor/ide-editor-workbench-addin.c
index adc528b..d5d2d70 100644
--- a/libide/editor/ide-editor-workbench-addin.c
+++ b/libide/editor/ide-editor-workbench-addin.c
@@ -88,7 +88,7 @@ ide_editor_workbench_addin_load (IdeWorkbenchAddin *addin,
 
   self->manager = pnl_dock_manager_new ();
 
-  header = IDE_WORKBENCH_HEADER_BAR (gtk_window_get_titlebar (GTK_WINDOW (workbench)));
+  header = ide_workbench_get_headerbar (workbench);
 
   self->new_document_button = g_object_new (GTK_TYPE_BUTTON,
                                             "action-name", "perspective.new-file",
diff --git a/plugins/build-tools/gbp-build-workbench-addin.c b/plugins/build-tools/gbp-build-workbench-addin.c
index 13e0b1f..9aa73bd 100644
--- a/plugins/build-tools/gbp-build-workbench-addin.c
+++ b/plugins/build-tools/gbp-build-workbench-addin.c
@@ -314,7 +314,7 @@ gbp_build_workbench_addin_load (IdeWorkbenchAddin *addin,
 
   g_object_bind_property (self, "result", self->panel, "result", 0);
 
-  header = IDE_WORKBENCH_HEADER_BAR (gtk_window_get_titlebar (GTK_WINDOW (workbench)));
+  header = ide_workbench_get_headerbar (workbench);
 
   self->run_button = g_object_new (GTK_TYPE_BUTTON,
                                    "child", g_object_new (GTK_TYPE_IMAGE,


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