[gimp] app: use GimpSpinScale for the new smoothing options



commit 70574877d3dd78c477a60302e395a31de20df750
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jan 9 00:21:10 2011 +0100

    app: use GimpSpinScale for the new smoothing options
    
    This drops the log scale, but the new widget will get a better
    solution for this anyway. Also did some cleanup.

 app/tools/gimppaintoptions-gui.c |   69 ++++++++++++++++++--------------------
 1 files changed, 33 insertions(+), 36 deletions(-)
---
diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c
index 9f9a8e1..16af2e6 100644
--- a/app/tools/gimppaintoptions-gui.c
+++ b/app/tools/gimppaintoptions-gui.c
@@ -57,11 +57,10 @@ static void gimp_paint_options_gui_reset_size (GtkWidget        *button,
 
 static GtkWidget * dynamics_options_gui       (GimpPaintOptions *paint_options,
                                                GType             tool_type);
-
-static GtkWidget * jitter_options_gui    (GimpPaintOptions *paint_options,
-                                          GType             tool_type);
-static GtkWidget * smoothing_options_gui (GimpPaintOptions *paint_options,
-                                          GType             tool_type);
+static GtkWidget * jitter_options_gui         (GimpPaintOptions *paint_options,
+                                               GType             tool_type);
+static GtkWidget * smoothing_options_gui      (GimpPaintOptions *paint_options,
+                                               GType             tool_type);
 
 
 /*  public functions  */
@@ -318,49 +317,47 @@ jitter_options_gui (GimpPaintOptions *paint_options,
   return frame;
 }
 
-static void
-gimp_paint_options_gui_reset_size (GtkWidget        *button,
-                                   GimpPaintOptions *paint_options)
-{
- GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
-
- if (brush)
-   {
-     g_object_set (paint_options,
-                   "brush-size", (gdouble) MAX (brush->mask->width,
-                                                brush->mask->height),
-                   NULL);
-   }
-}
-
 static GtkWidget *
 smoothing_options_gui (GimpPaintOptions *paint_options,
                        GType             tool_type)
 {
   GObject   *config = G_OBJECT (paint_options);
   GtkWidget *frame;
-  GtkWidget *table;
-  GtkObject *factor;
+  GtkWidget *vbox;
+  GtkWidget *scale;
 
-  table = gtk_table_new (2, 3, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 2);
+  vbox = gtk_vbox_new (FALSE, 2);
 
   frame = gimp_prop_expanding_frame_new (config, "use-smoothing",
                                          _("Smooth stroke"),
-                                         table, NULL);
+                                         vbox, NULL);
 
-  gimp_prop_scale_entry_new (config, "smoothing-quality",
-                             GTK_TABLE (table), 0, 0,
-                             _("Quality:"),
-                             1, 10, 1,
-                             FALSE, 0, 100);
+  scale = gimp_prop_spin_scale_new (config, "smoothing-quality",
+                                    _("Quality"),
+                                    1, 10, 1);
+  gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
+  gtk_widget_show (scale);
 
-  factor = gimp_prop_scale_entry_new (config, "smoothing-factor",
-                                      GTK_TABLE (table), 0, 1,
-                                      _("Factor:"),
-                                      1, 10, 1,
-                                      FALSE, 0, 100);
-  gimp_scale_entry_set_logarithmic (factor, TRUE);
+  scale = gimp_prop_spin_scale_new (config, "smoothing-factor",
+                                    _("Factor"),
+                                    1, 10, 1);
+  gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
+  gtk_widget_show (scale);
 
   return frame;
 }
+
+static void
+gimp_paint_options_gui_reset_size (GtkWidget        *button,
+                                   GimpPaintOptions *paint_options)
+{
+ GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));
+
+ if (brush)
+   {
+     g_object_set (paint_options,
+                   "brush-size", (gdouble) MAX (brush->mask->width,
+                                                brush->mask->height),
+                   NULL);
+   }
+}



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