diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-12-21 10:54:43 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-12-21 10:54:43 (GMT) |
commit | 6a444b273cf812c080c57d36a43436bf4aa4d55e (patch) | |
tree | 3c46c6e170439436c63f538c3d3ac514eeb68825 /src/gui | |
parent | a34a6015b31f79a7f3b8abc68e3bf05f4a5b9ad0 (diff) |
Centered graph view content at first display.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/menus/view.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index 63b6371..059a598 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -40,6 +40,7 @@ #include "../core/panels.h" #include "../../analysis/loaded.h" #include "../../gtkext/easygtk.h" +#include "../../gtkext/gtkgraphdisplay.h" @@ -758,6 +759,8 @@ static void mcb_view_switch_to_prev_support(GtkRadioMenuItem *menuitem, gpointer static void handle_loaded_panel_first_allocation(GtkWidget *widget, GdkRectangle *alloc, GLineCursor *cursor) { + GtkAllocation allocation; /* Emplacement effectif */ + /* On ne réagit que la première fois */ g_signal_handlers_disconnect_by_func(widget, G_CALLBACK(handle_loaded_panel_first_allocation), cursor); @@ -765,6 +768,19 @@ static void handle_loaded_panel_first_allocation(GtkWidget *widget, GdkRectangle g_object_unref(G_OBJECT(cursor)); + /** + * Pour les mêmes raisons que celles exposées dans change_current_view_support(), + * l'affichage en vue graphique n'est pas centré initialement. + * + * On profite donc de ce crochet pour corriger le tir ! + */ + + if (GTK_IS_GRAPH_DISPLAY(widget)) + { + gtk_widget_get_allocation(widget, &allocation); + gtk_widget_size_allocate(widget, &allocation); + } + } |