Code

Pack combo boxes into GtkAlignment for natural size when used in toolbars.
authorJon A. Cruz <jon@joncruz.org>
Sun, 25 Apr 2010 08:56:03 +0000 (01:56 -0700)
committerJon A. Cruz <jon@joncruz.org>
Sun, 25 Apr 2010 08:56:03 +0000 (01:56 -0700)
src/ink-comboboxentry-action.cpp

index 85e9378c8e214f7f195eb5cdae600fc8320e5055..60332e02ea72d2363dfa040758dfb96739dda6df 100644 (file)
@@ -312,7 +312,11 @@ GtkWidget* create_tool_item( GtkAction* action )
 
     GtkWidget* comboBoxEntry = gtk_combo_box_entry_new_with_model( ink_comboboxentry_action->model, 0 );
 
-    gtk_container_add( GTK_CONTAINER(item), comboBoxEntry );
+    {
+        GtkWidget *align = gtk_alignment_new(0, 0.5, 0, 0);
+        gtk_container_add( GTK_CONTAINER(align), comboBoxEntry );
+        gtk_container_add( GTK_CONTAINER(item), align );
+    }
 
     ink_comboboxentry_action->combobox = GTK_COMBO_BOX_ENTRY(comboBoxEntry);
 
@@ -347,7 +351,7 @@ GtkWidget* create_tool_item( GtkAction* action )
 
       // Add altx_name if required
       if( ink_comboboxentry_action->altx_name ) {
-       g_object_set_data( G_OBJECT( child ), ink_comboboxentry_action->altx_name, ink_comboboxentry_action->entry );
+          g_object_set_data( G_OBJECT( child ), ink_comboboxentry_action->altx_name, ink_comboboxentry_action->entry );
       }
 
       // Add signal for GtkEntry to check if finished typing.