From 6d88af0d05807f1c020a7c2db0e11fc3154944b1 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Wed, 6 Mar 2024 14:37:33 +0000 Subject: [PATCH] Bug fix: No toolbars on first entry When Geeqie is started for the first time and geeqierc.xml does not exist, the toolbars were not set to the default values. --- src/layout-util.cc | 20 ++++++++++++-------- src/layout-util.h | 3 +++ src/layout.cc | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/layout-util.cc b/src/layout-util.cc index 4b0ec524..d3b2f684 100644 --- a/src/layout-util.cc +++ b/src/layout-util.cc @@ -3139,10 +3139,21 @@ static void layout_actions_setup_editors(LayoutWindow *lw) g_list_free(editors_list); } +void create_toolbars(LayoutWindow *lw) +{ + gint i; + + for (i = 0; i < TOOLBAR_COUNT; i++) + { + layout_actions_toolbar(lw, static_cast(i)); + layout_toolbar_clear(lw, static_cast(i)); + layout_toolbar_add_default(lw, static_cast(i)); + } +} + void layout_actions_setup(LayoutWindow *lw) { GError *error; - gint i; DEBUG_1("%s layout_actions_setup: start", get_exec_time()); if (lw->ui_manager) return; @@ -3191,13 +3202,6 @@ void layout_actions_setup(LayoutWindow *lw) exit(EXIT_FAILURE); } - DEBUG_1("%s layout_actions_setup: add toolbar", get_exec_time()); - for (i = 0; i < TOOLBAR_COUNT; i++) - { - layout_toolbar_clear(lw, static_cast(i)); - layout_toolbar_add_default(lw, static_cast(i)); - } - DEBUG_1("%s layout_actions_setup: marks", get_exec_time()); layout_actions_setup_marks(lw); diff --git a/src/layout-util.h b/src/layout-util.h index 2c7ea04e..a82aa0e0 100644 --- a/src/layout-util.h +++ b/src/layout-util.h @@ -78,5 +78,8 @@ void layout_exif_window_new(LayoutWindow *lw); gboolean is_help_key(GdkEventKey *event); void layout_menu_close_cb(GtkAction *action, gpointer data); GtkWidget *layout_actions_menu_tool_bar(LayoutWindow *lw); + +void create_toolbars(LayoutWindow *lw); + #endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/layout.cc b/src/layout.cc index 0451c231..c478a79c 100644 --- a/src/layout.cc +++ b/src/layout.cc @@ -1847,6 +1847,7 @@ static void layout_grid_setup(LayoutWindow *lw) GtkWidget *files; layout_actions_setup(lw); + create_toolbars(lw); lw->group_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); DEBUG_NAME(lw->group_box); -- 2.20.1