[gimp] Bug 699278 - "GEGL Operation" parameter arrows should be more adapted



commit acf917fbb8264f56f44d152a851bb1fc40e06c11
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 19 19:05:25 2013 +0200

    Bug 699278 - "GEGL Operation" parameter arrows should be more adapted
    
    to the span of the parameter
    
    Set step_size to 0.1 and page_size to 1.0 for floating point sliders
    with a value range of < 10.0.

 app/widgets/gimppropwidgets.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c
index c0d8d6a..96aa9ab 100644
--- a/app/widgets/gimppropwidgets.c
+++ b/app/widgets/gimppropwidgets.c
@@ -1577,7 +1577,7 @@ gimp_prop_table_new (GObject              *config,
 
           scale = gimp_prop_spin_scale_new (config, pspec->name,
                                             g_param_spec_get_nick (pspec),
-                                            1.0, 1.0, 0);
+                                            1.0, 10.0, 0);
           gtk_box_pack_start (GTK_BOX (widget), scale, TRUE, TRUE, 0);
           gtk_widget_show (scale);
 
@@ -1597,12 +1597,29 @@ gimp_prop_table_new (GObject              *config,
                G_IS_PARAM_SPEC_DOUBLE (pspec))
         {
           GtkAdjustment *adj;
+          gdouble        value;
+          gdouble        lower;
+          gdouble        upper;
+          gdouble        step   = 1.0;
+          gdouble        page   = 10.0;
           gint           digits = (G_IS_PARAM_SPEC_FLOAT (pspec) ||
                                    G_IS_PARAM_SPEC_DOUBLE (pspec)) ? 2 : 0;
 
+          get_numeric_values (config, pspec,
+                              &value, &lower, &upper, G_STRFUNC);
+
+          if ((upper - lower < 10.0) &&
+              (G_IS_PARAM_SPEC_FLOAT (pspec) ||
+               G_IS_PARAM_SPEC_DOUBLE (pspec)))
+            {
+              step   = 0.1;
+              page   = 1.0;
+              digits = 3;
+            }
+
           widget = gimp_prop_spin_scale_new (config, pspec->name,
                                              g_param_spec_get_nick (pspec),
-                                             1.0, 1.0, digits);
+                                             step, page, digits);
 
           adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
 


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