]> git.sur5r.net Git - glabels/commitdiff
Fix maximum size of object editor sidebar at initialization. upstream/zint
authorJim Evins <evins@snaught.com>
Wed, 1 Sep 2010 01:48:50 +0000 (21:48 -0400)
committerJim Evins <evins@snaught.com>
Wed, 1 Sep 2010 01:48:50 +0000 (21:48 -0400)
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
src/object-editor-bc-page.c

index 59a2fc40bbf344722e8df464f4de94b5f90255a8..cac447e95490bb064bfd60af5fa35f2480e8e796 100644 (file)
                           <object class="GtkLabel" id="bc_be_label">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Backend engine:</property>
+                            <property name="label" translatable="yes">Backend:</property>
                           </object>
                           <packing>
                             <property name="x_options">GTK_FILL</property>
   <object class="GtkSizeGroup" id="page_sizegroup">
     <property name="mode">both</property>
     <widgets>
-      <widget name="shadow_page_vbox"/>
-      <widget name="lsize_page_vbox"/>
-      <widget name="size_page_vbox"/>
-      <widget name="bc_page_vbox"/>
-      <widget name="data_page_vbox"/>
-      <widget name="img_page_vbox"/>
-      <widget name="fill_page_vbox"/>
-      <widget name="line_page_vbox"/>
-      <widget name="text_page_vbox"/>
       <widget name="edit_page_vbox"/>
+      <widget name="text_page_vbox"/>
+      <widget name="line_page_vbox"/>
+      <widget name="fill_page_vbox"/>
+      <widget name="img_page_vbox"/>
+      <widget name="data_page_vbox"/>
+      <widget name="bc_page_vbox"/>
+      <widget name="size_page_vbox"/>
+      <widget name="lsize_page_vbox"/>
+      <widget name="shadow_page_vbox"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="width_sizegroup">
     <widgets>
-      <widget name="notebook"/>
       <widget name="title_hbox"/>
+      <widget name="notebook"/>
     </widgets>
   </object>
 </interface>
index bce9a2a8830eadd47163e9ca2fb22025226048fd..f6d55573e70ccd08555162aea2fea19a2ce58698 100644 (file)
@@ -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;