summaryrefslogtreecommitdiff
path: root/src/gui/tb
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-20 21:49:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-20 21:49:12 (GMT)
commit384cba185a99ea30d3c1f13a151679a123f74acc (patch)
tree3750d75a81ea1dbc79b24f39bbe8c2a667566a24 /src/gui/tb
parent8e56898ab1054f3fbeff85c393364dc943fa942a (diff)
Hidden the main toolbar when it gets useless.
Diffstat (limited to 'src/gui/tb')
-rw-r--r--src/gui/tb/portions.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/tb/portions.c b/src/gui/tb/portions.c
index 202cd43..a8eb606 100644
--- a/src/gui/tb/portions.c
+++ b/src/gui/tb/portions.c
@@ -221,6 +221,7 @@ GEditorItem *create_portions_tb_item(GObject *ref)
static void change_portions_tbitem_current_content(GEditorItem *item, GLoadedContent *old, GLoadedContent *new)
{
GLoadedBinary *binary; /* Autre version de l'instance */
+ GtkWidget *widget; /* Elément graphique principal */
GtkBinaryStrip *strip; /* Bande pour binaire */
if (G_IS_LOADED_BINARY(new))
@@ -228,9 +229,17 @@ static void change_portions_tbitem_current_content(GEditorItem *item, GLoadedCon
else
binary = NULL;
- strip = GTK_BINARY_STRIP(g_object_get_data(G_OBJECT(item->widget), "strip"));
+ widget = g_editor_item_get_widget(item);
- gtk_binary_strip_attach(strip, binary);
+ strip = GTK_BINARY_STRIP(g_object_get_data(G_OBJECT(widget), "strip"));
+
+ if (binary != NULL)
+ {
+ gtk_binary_strip_attach(strip, binary);
+ gtk_widget_show(GTK_WIDGET(widget));
+ }
+ else
+ gtk_widget_hide(GTK_WIDGET(widget));
}