[gimp] app: get rid of more tables in the tool options and fix up spacing a bit



commit d5ff5b6748cad60b24044d436285da39c777d0eb
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 2 22:14:34 2010 +0100

    app: get rid of more tables in the tool options and fix up spacing a bit

 app/tools/gimpblendoptions.c     |   19 +++++++++--------
 app/tools/gimppaintoptions-gui.c |   40 ++++++++-----------------------------
 app/tools/gimppaintoptions-gui.h |    3 --
 app/tools/gimptooloptions-gui.c  |    2 +-
 4 files changed, 20 insertions(+), 44 deletions(-)
---
diff --git a/app/tools/gimpblendoptions.c b/app/tools/gimpblendoptions.c
index 96c204d..91708db 100644
--- a/app/tools/gimpblendoptions.c
+++ b/app/tools/gimpblendoptions.c
@@ -206,31 +206,34 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
   GtkWidget *combo;
   GtkWidget *button;
 
-  table = g_object_get_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY);
-
   /*  the gradient  */
   button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (tool_options),
                                        _("Gradient"), 2,
                                        "gradient-view-type",
                                        "gradient-view-size",
                                        "gradient-reverse");
-  gtk_table_attach (GTK_TABLE (table), button, 0, 3, 2, 3,
-                    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 
+  table = gtk_table_new (3, 2, FALSE);
+  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
+  gtk_table_set_row_spacings (GTK_TABLE (table), 2);
+  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+  gtk_widget_show (table);
+
   /*  the gradient type menu  */
   combo = gimp_prop_enum_combo_box_new (config, "gradient-type", 0, 0);
   g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
   gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo),
                                         "gimp-gradient");
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
+  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("Shape:"), 0.0, 0.5,
                              combo, 2, FALSE);
 
   /*  the repeat option  */
   combo = gimp_prop_enum_combo_box_new (config, "gradient-repeat", 0, 0);
   g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
+  gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("Repeat:"), 0.0, 0.5,
                              combo, 2, FALSE);
 
@@ -242,9 +245,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
   scale = gimp_prop_spin_scale_new (config, "offset",
                                     _("Offset"),
                                     1.0, 10.0, 1);
-  gtk_table_attach (GTK_TABLE (table), scale,
-                    0, 3, 5, 6,
-                    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
   gtk_widget_show (scale);
 
   /*  the dither toggle  */
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index 8f99549..335c396 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -80,23 +80,19 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
   GtkWidget        *label;
   GtkWidget        *button;
   GtkWidget        *incremental_toggle = NULL;
-  gint              table_row          = 0;
   GType             tool_type;
 
   tool_type = tool_options->tool_info->tool_type;
 
   /*  the main table  */
-  table = gtk_table_new (3, 4, FALSE);
+  table = gtk_table_new (3, 1, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 2);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 2);
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  g_object_set_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY, table);
-
   /*  the paint mode menu  */
   menu  = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE, FALSE);
-  label = gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
+  label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                                      _("Mode:"), 0.0, 0.5,
                                      menu, 2, FALSE);
 
@@ -112,43 +108,30 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
   /*  the opacity scale  */
   scale = gimp_prop_opacity_spin_scale_new (config, "opacity",
                                             _("Opacity"));
-  gtk_table_attach (GTK_TABLE (table), scale,
-                    0, 3, table_row, table_row + 1,
-                    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
   gtk_widget_show (scale);
-  table_row++;
 
   /*  the brush  */
   if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
     {
-      GtkObject *adj;
       GtkWidget *hbox;
 
       button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options),
                                         _("Brush"), 2,
                                         "brush-view-type", "brush-view-size");
-      gtk_table_attach (GTK_TABLE (table), button,
-                        0, 3, table_row, table_row + 1,
-                        GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+      gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
       gtk_widget_show (button);
-      table_row++;
 
       button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options),
                                            _("Dynamics"), 2,
                                            "dynamics-view-type",
                                            "dynamics-view-size");
-      gtk_table_attach (GTK_TABLE (table), button,
-                        0, 3, table_row, table_row + 1,
-                        GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+      gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
       gtk_widget_show (button);
-      table_row++;
 
       hbox = gtk_hbox_new (FALSE, 2);
-      gtk_table_attach (GTK_TABLE (table), hbox,
-                        0, 3, table_row, table_row + 1,
-                        GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+      gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
       gtk_widget_show (hbox);
-      table_row++;
 
       scale = gimp_prop_spin_scale_new (config, "brush-size",
                                         _("Size"),
@@ -170,20 +153,14 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
       scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
                                         _("Aspect Ratio"),
                                         0.01, 0.1, 2);
-      gtk_table_attach (GTK_TABLE (table), scale,
-                        0, 3, table_row, table_row + 1,
-                        GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+      gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
       gtk_widget_show (scale);
-      table_row++;
 
       scale = gimp_prop_spin_scale_new (config, "brush-angle",
                                         _("Angle"),
                                         1.0, 5.0, 2);
-      gtk_table_attach (GTK_TABLE (table), scale,
-                        0, 3, table_row, table_row + 1,
-                        GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_SHRINK, 0, 0);
+      gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
       gtk_widget_show (scale);
-      table_row++;
     }
 
   if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
@@ -253,6 +230,7 @@ fade_options_gui (GimpPaintOptions *paint_options,
 
   table = gtk_table_new (3, 3, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 2);
+  gtk_table_set_row_spacings (GTK_TABLE (table), 2);
 
   frame = gimp_prop_expanding_frame_new (config, "use-fade",
                                          _("Fade out"),
diff --git a/app/tools/gimppaintoptions-gui.h b/app/tools/gimppaintoptions-gui.h
index a50b3e3..fd042d4 100644
--- a/app/tools/gimppaintoptions-gui.h
+++ b/app/tools/gimppaintoptions-gui.h
@@ -19,9 +19,6 @@
 #define __GIMP_PAINT_OPTIONS_GUI_H__
 
 
-#define GIMP_PAINT_OPTIONS_TABLE_KEY "gimp-paint-options-table"
-
-
 GtkWidget * gimp_paint_options_gui (GimpToolOptions *tool_options);
 
 
diff --git a/app/tools/gimptooloptions-gui.c b/app/tools/gimptooloptions-gui.c
index 6997459..d89290b 100644
--- a/app/tools/gimptooloptions-gui.c
+++ b/app/tools/gimptooloptions-gui.c
@@ -35,7 +35,7 @@ gimp_tool_options_gui (GimpToolOptions *tool_options)
 
   g_return_val_if_fail (GIMP_IS_TOOL_OPTIONS (tool_options), NULL);
 
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_vbox_new (FALSE, 4);
 
   return vbox;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]