[gimp] app: use the GParamSpec's nick as label in gimp_prop_spin_scale_new()



commit 1464bee25798437b5bf8f42cd248b3ec0e4dd486
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 1 23:39:19 2014 +0200

    app: use the GParamSpec's nick as label in gimp_prop_spin_scale_new()
    
    if a NULL label was passed. Override this with explicit calls to
    gimp_spin_scale_set_label() in the two cases where we really don't
    want a label.

 app/tools/gimpcolorbalancetool.c |    1 +
 app/tools/gimptransformoptions.c |    2 ++
 app/widgets/gimppropwidgets.c    |    3 +++
 3 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c
index 0e87956..9544bf9 100644
--- a/app/tools/gimpcolorbalancetool.c
+++ b/app/tools/gimpcolorbalancetool.c
@@ -168,6 +168,7 @@ create_levels_scale (GObject     *config,
 
   scale = gimp_prop_spin_scale_new (config, property_name,
                                     NULL, 0.01, 0.1, 0);
+  gimp_spin_scale_set_label (GIMP_SPIN_SCALE (scale), NULL);
   gimp_prop_widget_set_factor (scale, 100.0, 0.0, 0.0, 1);
   gtk_table_attach_defaults (GTK_TABLE (table), scale, 1, 2, col, col + 1);
   gtk_widget_show (scale);
diff --git a/app/tools/gimptransformoptions.c b/app/tools/gimptransformoptions.c
index 4cc1e25..e12d345 100644
--- a/app/tools/gimptransformoptions.c
+++ b/app/tools/gimptransformoptions.c
@@ -31,6 +31,7 @@
 #include "core/gimptoolinfo.h"
 
 #include "widgets/gimppropwidgets.h"
+#include "widgets/gimpspinscale.h"
 #include "widgets/gimpwidgets-utils.h"
 
 #include "gimprotatetool.h"
@@ -438,6 +439,7 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
   /*  the grid density scale  */
   scale = gimp_prop_spin_scale_new (config, "grid-size", NULL,
                                     1.8, 8.0, 0);
+  gimp_spin_scale_set_label (GIMP_SPIN_SCALE (scale), NULL);
   gtk_container_add (GTK_CONTAINER (frame), scale);
 
   g_object_bind_property_full (config, "grid-type",
diff --git a/app/widgets/gimppropwidgets.c b/app/widgets/gimppropwidgets.c
index 248af86..8635b31 100644
--- a/app/widgets/gimppropwidgets.c
+++ b/app/widgets/gimppropwidgets.c
@@ -497,6 +497,9 @@ gimp_prop_spin_scale_new (GObject     *config,
   if (! G_IS_PARAM_SPEC_DOUBLE (param_spec))
     digits = 0;
 
+  if (! label)
+    label = g_param_spec_get_nick (param_spec);
+
   adjustment = gtk_adjustment_new (value, lower, upper,
                                    step_increment, page_increment, 0.0);
 


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