[gnome-builder] symbols: hide symbol browser until symbols are retrieved



commit 340b1efbe1fe24f87a22462a1205c98ba8418286
Author: Christian Hergert <christian hergert me>
Date:   Sun Mar 29 01:06:13 2015 -0700

    symbols: hide symbol browser until symbols are retrieved

 data/ui/gb-editor-view.ui           |    2 +-
 src/editor/gb-editor-view-private.h |    1 +
 src/editor/gb-editor-view.c         |    4 ++++
 3 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/gb-editor-view.ui b/data/ui/gb-editor-view.ui
index 80fe0b3..a81e603 100644
--- a/data/ui/gb-editor-view.ui
+++ b/data/ui/gb-editor-view.ui
@@ -90,7 +90,7 @@
             <child>
               <object class="GtkMenuButton" id="symbols_button">
                 <property name="popover">symbols_popover</property>
-                <property name="visible">true</property>
+                <property name="visible">false</property>
                 <style>
                   <class name="dim-label"/>
                   <class name="text-button"/>
diff --git a/src/editor/gb-editor-view-private.h b/src/editor/gb-editor-view-private.h
index 3e2f2de..60d9bd4 100644
--- a/src/editor/gb-editor-view-private.h
+++ b/src/editor/gb-editor-view-private.h
@@ -42,6 +42,7 @@ struct _GbEditorView
   GtkRevealer         *modified_revealer;
   GtkPaned            *paned;
   GtkProgressBar      *progress_bar;
+  GtkMenuButton       *symbols_button;
   GtkListBox          *symbols_listbox;
   GtkSearchEntry      *symbols_search_entry;
   GtkMenuButton       *tweak_button;
diff --git a/src/editor/gb-editor-view.c b/src/editor/gb-editor-view.c
index a94cb90..f9c80a0 100644
--- a/src/editor/gb-editor-view.c
+++ b/src/editor/gb-editor-view.c
@@ -224,6 +224,7 @@ gb_editor_view_update_symbols_cb (GObject      *object,
 
   if (ret == NULL)
     {
+      gtk_widget_hide (GTK_WIDGET (self->symbols_button));
       if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
         g_warning ("%s", error->message);
       return;
@@ -262,6 +263,8 @@ gb_editor_view_update_symbols_cb (GObject      *object,
       gtk_container_add (GTK_CONTAINER (row), GTK_WIDGET (label));
       gtk_container_add (GTK_CONTAINER (self->symbols_listbox), GTK_WIDGET (row));
     }
+
+  gtk_widget_show (GTK_WIDGET (self->symbols_button));
 }
 
 static gboolean
@@ -598,6 +601,7 @@ gb_editor_view_class_init (GbEditorViewClass *klass)
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, modified_revealer);
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, paned);
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, progress_bar);
+  GB_WIDGET_CLASS_BIND (klass, GbEditorView, symbols_button);
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, symbols_listbox);
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, symbols_search_entry);
   GB_WIDGET_CLASS_BIND (klass, GbEditorView, tweak_button);


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