Fix #999: Adding a widget to the info sidebar resizes the sidebar to something around...
authorColin Clark <colin.clark@cclark.uk>
Fri, 12 Aug 2022 15:20:22 +0000 (16:20 +0100)
committerColin Clark <colin.clark@cclark.uk>
Fri, 12 Aug 2022 15:20:22 +0000 (16:20 +0100)
https://github.com/BestImageViewer/geeqie/issues/999

src/bar.c
src/bar.h
src/rcfile.c

index 610652b..3005994 100644 (file)
--- a/src/bar.c
+++ b/src/bar.c
@@ -815,7 +815,7 @@ GtkWidget *bar_new(LayoutWindow *lw)
 }
 
 
-GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, const gchar **attribute_values, LayoutWindow *lw)
+GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, const gchar **attribute_values, LayoutWindow *lw, gboolean startup)
 {
        gboolean enabled = TRUE;
        gint width = SIDEBAR_DEFAULT_WIDTH;
@@ -832,7 +832,10 @@ GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names,
                log_printf("unknown attribute %s = %s\n", option, value);
                }
 
-       gtk_paned_set_position(GTK_PANED(lw->utility_paned), width);
+       if (startup)
+               {
+               gtk_paned_set_position(GTK_PANED(lw->utility_paned), width);
+               }
 
        if (enabled)
                {
@@ -848,7 +851,7 @@ GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names,
 GtkWidget *bar_new_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
 {
        GtkWidget *bar = bar_new(lw);
-       return bar_update_from_config(bar, attribute_names, attribute_values, lw);
+       return bar_update_from_config(bar, attribute_names, attribute_values, lw, TRUE);
 }
 
 GtkWidget *bar_pane_expander_title(const gchar *title)
index 6569122..551eac4 100644 (file)
--- a/src/bar.h
+++ b/src/bar.h
@@ -53,7 +53,7 @@ struct _PaneData {
 
 GtkWidget *bar_new(LayoutWindow *lw);
 GtkWidget *bar_new_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values);
-GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, const gchar **attribute_values, LayoutWindow *lw);
+GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, const gchar **attribute_values, LayoutWindow *lw, gboolean startup);
 
 void bar_close(GtkWidget *bar);
 
index 1b7a225..f19cdc7 100644 (file)
@@ -1578,7 +1578,7 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext
                        }
                else
                        {
-                       bar_update_from_config(lw->bar, attribute_names, attribute_values, lw);
+                       bar_update_from_config(lw->bar, attribute_names, attribute_values, lw, FALSE);
                        }
 
                options_parse_func_push(parser_data, options_parse_bar, NULL, lw->bar);