[gimp/gimp-2-10] app: in _gimp_prop_gui_new_generic(), use "range-label" pspec key as range label



commit b6e0333aa0ada9746320e253b21663a5a95f49f5
Author: Ell <ell_se yahoo com>
Date:   Tue Jun 2 23:54:15 2020 +0300

    app: in _gimp_prop_gui_new_generic(), use "range-label" pspec key as range label
    
    ... when available
    
    (cherry picked from commit 4492f61df4483aad5cb34b4cfb9c741c549fc572)

 app/propgui/gimppropgui-generic.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/app/propgui/gimppropgui-generic.c b/app/propgui/gimppropgui-generic.c
index 8797dcfbd0..7245fe2912 100644
--- a/app/propgui/gimppropgui-generic.c
+++ b/app/propgui/gimppropgui-generic.c
@@ -205,6 +205,7 @@ _gimp_prop_gui_new_generic (GObject                  *config,
           GtkWidget   *frame;
           GtkWidget   *range;
           const gchar *label_str;
+          const gchar *range_label_str;
           gdouble      step_increment;
           gdouble      page_increment;
           gdouble      ui_lower;
@@ -223,6 +224,12 @@ _gimp_prop_gui_new_generic (GObject                  *config,
             creator,
             &label_str);
 
+          range_label_str = gegl_param_spec_get_property_key (pspec,
+                                                              "range-label");
+
+          if (range_label_str)
+            label_str = range_label_str;
+
           g_object_set_data_full (G_OBJECT (vbox),
                                   "gimp-underlying-widget",
                                   g_object_ref_sink (spin_scale),
@@ -239,9 +246,12 @@ _gimp_prop_gui_new_generic (GObject                  *config,
           gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
           gtk_widget_show (label);
 
-          g_object_bind_property (spin_scale, "label",
-                                  label,      "label",
-                                  G_BINDING_SYNC_CREATE);
+          if (! range_label_str)
+            {
+              g_object_bind_property (spin_scale, "label",
+                                      label,      "label",
+                                      G_BINDING_SYNC_CREATE);
+            }
 
           frame = gimp_frame_new (NULL);
           gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);


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