[gimp] app: use 1 and 15 increments for GEGL properties with the unit "degree"



commit 4900da3183a30500fb1687cfadf78368ecf9b5b2
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 18 22:58:51 2014 +0200

    app: use 1 and 15 increments for GEGL properties with the unit "degree"

 app/widgets/gimpproptable.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpproptable.c b/app/widgets/gimpproptable.c
index e87c13a..31c1270 100644
--- a/app/widgets/gimpproptable.c
+++ b/app/widgets/gimpproptable.c
@@ -235,14 +235,35 @@ gimp_prop_table_new (GObject              *config,
                                                      G_STRFUNC);
             }
 
-          if ((upper - lower < 10.0) &&
-              (G_IS_PARAM_SPEC_FLOAT (pspec) ||
-               G_IS_PARAM_SPEC_DOUBLE (pspec)))
+          if (HAS_KEY (pspec, "unit", "degree"))
+            {
+              step   = 1.0;
+              page   = 15.0;
+              digits = 2;
+            }
+          else if ((upper - lower <= 1.0) &&
+                   (G_IS_PARAM_SPEC_FLOAT (pspec) ||
+                    G_IS_PARAM_SPEC_DOUBLE (pspec)))
+            {
+              step   = 0.01;
+              page   = 0.1;
+              digits = 4;
+            }
+          else 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;
             }
+          else
+            {
+              step   = 1.0;
+              page   = 10.0;
+              digits = (G_IS_PARAM_SPEC_FLOAT (pspec) ||
+                        G_IS_PARAM_SPEC_DOUBLE (pspec)) ? 2 : 0;
+            }
 
           widget = gimp_prop_spin_scale_new (config, pspec->name,
                                              g_param_spec_get_nick (pspec),


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