diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-07-16 20:11:21 (GMT) |
commit | f6e56cebfa878dd32a2405fd0c916a40140a1ff0 (patch) | |
tree | 3e364d2e2b2de19b85ab6d14f856d4b8db11737a /src/gui/editor.c | |
parent | e0d03e3eddb9d240cc21ac1b7a7ade915fd17942 (diff) |
Applied a new GUI update with the new loaded panels features.
Diffstat (limited to 'src/gui/editor.c')
-rw-r--r-- | src/gui/editor.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/gui/editor.c b/src/gui/editor.c index d63b3a9..3b8497c 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -389,7 +389,8 @@ GtkWidget *create_editor(void) register_project_change_notification(notify_editor_project_change); - change_editor_items_current_binary(NULL); + change_editor_items_current_content(NULL); + change_editor_items_current_view(NULL); @@ -1374,8 +1375,8 @@ void on_panel_item_undock_request(GPanelItem *panel, gpointer unused) static void on_dock_item_switch(GtkDockStation *station, GtkWidget *widget, gpointer unused) { - GLoadedBinary *old_binary; /* Ancien binaire édité */ - GLoadedBinary *binary; /* Binaire en cours d'édition */ + GLoadedPanel *panel; /* Vue du contenu chargé */ + GLoadedContent *content; /* Contenu en cours d'édition */ if (GTK_IS_SCROLLED_WINDOW(widget)) widget = gtk_bin_get_child(GTK_BIN(widget)); @@ -1383,23 +1384,17 @@ static void on_dock_item_switch(GtkDockStation *station, GtkWidget *widget, gpoi if (GTK_IS_VIEWPORT(widget)) widget = gtk_bin_get_child(GTK_BIN(widget)); - if (GTK_IS_DISPLAY_PANEL(widget)) + if (G_IS_LOADED_PANEL(widget)) { - /* Changement de binaire ? */ + panel = G_LOADED_PANEL(widget); - old_binary = get_current_binary(); - binary = gtk_display_panel_get_binary(GTK_DISPLAY_PANEL(widget)); + content = g_loaded_panel_get_content(panel); - if (old_binary != binary) - change_editor_items_current_binary(binary); - else - g_object_unref(G_OBJECT(binary)); + change_editor_items_current_content(content); - if (old_binary != NULL) - g_object_unref(G_OBJECT(old_binary)); + g_object_unref(G_OBJECT(content)); - g_object_ref(G_OBJECT(widget)); - change_editor_items_current_view(G_LOADED_PANEL(widget)); + change_editor_items_current_view(panel); } |