From e68145406dd9ea1326cace7341fa736e8e065bff Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Tue, 31 Aug 2010 21:48:50 -0400 Subject: [PATCH] Fix maximum size of object editor sidebar at initialization. Kludge: Load barcode styles for each backend type at initialization, so that when they are loaded for real, the maximum size of the widget has already been established and doesn't cause the object editor to change size. --- data/ui/object-editor.ui | 22 +++++++++++----------- src/object-editor-bc-page.c | 12 ++++++++++-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/data/ui/object-editor.ui b/data/ui/object-editor.ui index 59a2fc40..cac447e9 100644 --- a/data/ui/object-editor.ui +++ b/data/ui/object-editor.ui @@ -1169,7 +1169,7 @@ True 0 - Backend engine: + Backend: GTK_FILL @@ -2272,22 +2272,22 @@ both - - - - - - - - - + + + + + + + + + - + diff --git a/src/object-editor-bc-page.c b/src/object-editor-bc-page.c index bce9a2a8..f6d55573 100644 --- a/src/object-editor-bc-page.c +++ b/src/object-editor-bc-page.c @@ -71,6 +71,7 @@ void gl_object_editor_prepare_bc_page (glObjectEditor *editor) { GList *backends = NULL; + GList *p; gl_debug (DEBUG_EDITOR, "START"); @@ -112,6 +113,14 @@ gl_object_editor_prepare_bc_page (glObjectEditor *editor) backends = gl_barcode_backends_get_backend_list (); gl_combo_util_set_strings (GTK_COMBO_BOX(editor->priv->bc_backend_combo), backends); + + /* Kludge: Load styles for each backend once, so that when they are loaded for real the size of + * of the widget has already been established and does't cause the sidebar to change size. */ + for ( p = backends; p != NULL; p=p->next ) + { + gl_object_editor_load_bc_styles (editor, gl_barcode_backends_backend_name_to_id ((gchar *)p->data)); + } + gl_barcode_backends_free_backend_list (backends); /* Modify widgets */ @@ -271,8 +280,7 @@ gl_object_editor_load_bc_styles (glObjectEditor *editor, editor->priv->stop_signals = TRUE; styles = gl_barcode_backends_get_styles_list (backend_id); - gl_combo_util_set_strings (GTK_COMBO_BOX(editor->priv->bc_style_combo), - styles); + gl_combo_util_set_strings (GTK_COMBO_BOX(editor->priv->bc_style_combo), styles); gl_barcode_backends_free_styles_list (styles); editor->priv->stop_signals = FALSE; -- 2.39.5