[gimp] app: remove another bunch of one-line GtkTables



commit aa7e7c153cbe1d152e1f58c4f95fa0bb5f9d0131
Author: Michael Natterer <mitch gimp org>
Date:   Mon Mar 12 20:12:11 2012 +0100

    app: remove another bunch of one-line GtkTables

 app/dialogs/image-new-dialog.c       |   21 +++++++++++++--------
 app/tools/gimpclonetool.c            |   18 ++++++++++--------
 app/tools/gimphealtool.c             |   23 +++++++++++++----------
 app/tools/gimppaintoptions-gui.c     |   18 ++++++++++--------
 app/tools/gimpperspectiveclonetool.c |   18 ++++++++++--------
 app/tools/gimpregionselectoptions.c  |   20 +++++++++++---------
 6 files changed, 67 insertions(+), 51 deletions(-)
---
diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c
index 74caf05..2897d33 100644
--- a/app/dialogs/image-new-dialog.c
+++ b/app/dialogs/image-new-dialog.c
@@ -82,7 +82,8 @@ image_new_dialog_new (GimpContext *context)
 {
   ImageNewDialog *dialog;
   GtkWidget      *main_vbox;
-  GtkWidget      *table;
+  GtkWidget      *hbox;
+  GtkWidget      *label;
   GimpSizeEntry  *entry;
 
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@@ -126,10 +127,14 @@ image_new_dialog_new (GimpContext *context)
                       main_vbox, TRUE, TRUE, 0);
   gtk_widget_show (main_vbox);
 
-  table = gtk_table_new (1, 2, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 6);
-  gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
-  gtk_widget_show (table);
+  /*  The template combo  */
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+  gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new_with_mnemonic (_("_Template:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   dialog->combo = g_object_new (GIMP_TYPE_CONTAINER_COMBO_BOX,
                                 "container",         context->gimp->templates,
@@ -139,10 +144,10 @@ image_new_dialog_new (GimpContext *context)
                                 "ellipsize",         PANGO_ELLIPSIZE_NONE,
                                 "focus-on-click",    FALSE,
                                 NULL);
+  gtk_box_pack_start (GTK_BOX (hbox), dialog->combo, TRUE, TRUE, 0);
+  gtk_widget_show (dialog->combo);
 
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-                             _("_Template:"),  0.0, 0.5,
-                             dialog->combo, 1, TRUE);
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->combo);
 
   g_signal_connect (dialog->context, "template-changed",
                     G_CALLBACK (image_new_template_changed),
diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c
index 5f91e00..ec827bc 100644
--- a/app/tools/gimpclonetool.c
+++ b/app/tools/gimpclonetool.c
@@ -102,8 +102,8 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
   GtkWidget *frame;
   GtkWidget *button;
   GtkWidget *hbox;
-  GtkWidget *table;
   GtkWidget *combo;
+  GtkWidget *label;
 
   frame = gimp_prop_enum_radio_frame_new (config, "clone-type",
                                           _("Source"), 0, 0);
@@ -121,15 +121,17 @@ gimp_clone_options_gui (GimpToolOptions *tool_options)
   gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
                              GIMP_PATTERN_CLONE, TRUE);
 
-  table = gtk_table_new (1, 2, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
-  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
-  gtk_widget_show (table);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new (_("Alignment:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-                             _("Alignment:"), 0.0, 0.5,
-                             combo, 1, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_show (combo);
 
   return vbox;
 }
diff --git a/app/tools/gimphealtool.c b/app/tools/gimphealtool.c
index acdd92a..f40bb7f 100644
--- a/app/tools/gimphealtool.c
+++ b/app/tools/gimphealtool.c
@@ -91,25 +91,28 @@ gimp_heal_options_gui (GimpToolOptions *tool_options)
   GObject   *config = G_OBJECT (tool_options);
   GtkWidget *vbox   = gimp_paint_options_gui (tool_options);
   GtkWidget *button;
-  GtkWidget *table;
+  GtkWidget *hbox;
+  GtkWidget *label;
   GtkWidget *combo;
 
-  /* create and attach the sample merged checkbox */
+  /* the sample merged checkbox */
   button = gimp_prop_check_button_new (config, "sample-merged",
                                        _("Sample merged"));
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 
-  /* create and attach the alignment options to a table */
-  table = gtk_table_new (1, 2, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
-  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
-  gtk_widget_show (table);
+  /* the alignment combo */
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new (_("Alignment:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-                             _("Alignment:"), 0.0, 0.5,
-                             combo, 1, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_show (combo);
 
   return vbox;
 }
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index 2899d19..9b3929f 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -271,7 +271,7 @@ dynamics_options_gui (GimpPaintOptions *paint_options,
   GObject   *config = G_OBJECT (paint_options);
   GtkWidget *frame;
   GtkWidget *inner_frame;
-  GtkWidget *table;
+  GtkWidget *label;
   GtkWidget *scale;
   GtkWidget *menu;
   GtkWidget *combo;
@@ -318,15 +318,17 @@ dynamics_options_gui (GimpPaintOptions *paint_options,
 #endif
 
   /*  the repeat type  */
-  table = gtk_table_new (1, 2, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
-  gtk_box_pack_start (GTK_BOX (inner_vbox), table, FALSE, FALSE, 0);
-  gtk_widget_show (table);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+  gtk_box_pack_start (GTK_BOX (inner_vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new (_("Repeat:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   combo = gimp_prop_enum_combo_box_new (config, "fade-repeat", 0, 0);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-                             _("Repeat:"), 0.0, 0.5,
-                             combo, 1, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_show (combo);
 
   checkbox = gimp_prop_check_button_new (config, "fade-reverse",
                                          _("Reverse"));
diff --git a/app/tools/gimpperspectiveclonetool.c b/app/tools/gimpperspectiveclonetool.c
index 5c68d4c..2069e59 100644
--- a/app/tools/gimpperspectiveclonetool.c
+++ b/app/tools/gimpperspectiveclonetool.c
@@ -881,7 +881,7 @@ gimp_perspective_clone_options_gui (GimpToolOptions *tool_options)
   GtkWidget *mode;
   GtkWidget *button;
   GtkWidget *hbox;
-  GtkWidget *table;
+  GtkWidget *label;
   GtkWidget *combo;
 
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
@@ -911,15 +911,17 @@ gimp_perspective_clone_options_gui (GimpToolOptions *tool_options)
   gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox,
                              GIMP_PATTERN_CLONE, TRUE);
 
-  table = gtk_table_new (1, 2, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
-  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
-  gtk_widget_show (table);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new (_("Alignment:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
-                             _("Alignment:"), 0.0, 0.5,
-                             combo, 1, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_show (combo);
 
   return vbox;
 }
diff --git a/app/tools/gimpregionselectoptions.c b/app/tools/gimpregionselectoptions.c
index 5933641..0ba2a29 100644
--- a/app/tools/gimpregionselectoptions.c
+++ b/app/tools/gimpregionselectoptions.c
@@ -194,8 +194,9 @@ gimp_region_select_options_gui (GimpToolOptions *tool_options)
   GObject   *config  = G_OBJECT (tool_options);
   GtkWidget *vbox    = gimp_selection_options_gui (tool_options);
   GtkWidget *button;
-  GtkWidget *table;
   GtkWidget *scale;
+  GtkWidget *hbox;
+  GtkWidget *label;
   GtkWidget *combo;
 
   /*  the select transparent areas toggle  */
@@ -218,16 +219,17 @@ gimp_region_select_options_gui (GimpToolOptions *tool_options)
   gtk_widget_show (scale);
 
   /*  the select criterion combo  */
-  table = gtk_table_new (1, 3, 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);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbox);
+
+  label = gtk_label_new (_("Select by:"));
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_widget_show (label);
 
   combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
-  gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
-                             _("Select by:"), 0.0, 0.5,
-                             combo, 2, FALSE);
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_show (combo);
 
   return vbox;
 }



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