From: Jim Evins Date: Wed, 1 Sep 2010 01:48:50 +0000 (-0400) Subject: Fix maximum size of object editor sidebar at initialization. X-Git-Tag: glabels-2_3_1~213^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e68145406dd9ea1326cace7341fa736e8e065bff;p=glabels 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. --- 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;