[totem] preferences: Bind some labels' visibility to their corresponding ranges



commit c9ef39a4742f658fa29af58576c9d00d3d2182f9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed May 5 19:46:12 2021 -0300

    preferences: Bind some labels' visibility to their corresponding ranges
    
    The hue, brightness, saturation, and contrast labels have their visibility
    programatically tied to their corresponding ranges. We can do that in the
    .ui file more easily.
    
    Bind these labels' visibility to their corresponding ranges' in the
    preferences.ui file itself.

 data/preferences.ui     | 8 ++++----
 src/totem-preferences.c | 2 --
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/data/preferences.ui b/data/preferences.ui
index 2948e81b3..f5448316e 100644
--- a/data/preferences.ui
+++ b/data/preferences.ui
@@ -530,7 +530,7 @@
 
                          <child>
                            <object class="GtkLabel" id="tpw_brightness_label">
-                             <property name="visible">True</property>
+                             <property name="visible" bind-source="tpw_bright_scale" bind-property="visible" 
bind-flags="default|sync-create"/>
                              <property name="label" translatable="yes">_Brightness:</property>
                              <property name="use_underline">True</property>
                              <property name="use_markup">False</property>
@@ -557,7 +557,7 @@
 
                          <child>
                            <object class="GtkLabel" id="tpw_contrast_label">
-                             <property name="visible">True</property>
+                             <property name="visible" bind-source="tpw_contrast_scale" 
bind-property="visible" bind-flags="default|sync-create"/>
                              <property name="label" translatable="yes">Co_ntrast:</property>
                              <property name="use_underline">True</property>
                              <property name="use_markup">False</property>
@@ -623,7 +623,7 @@
 
                          <child>
                            <object class="GtkLabel" id="tpw_saturation_label">
-                             <property name="visible">True</property>
+                             <property name="visible" bind-source="tpw_saturation_scale" 
bind-property="visible" bind-flags="default|sync-create"/>
                              <property name="label" translatable="yes">Sat_uration:</property>
                              <property name="use_underline">True</property>
                              <property name="use_markup">False</property>
@@ -650,7 +650,7 @@
 
                          <child>
                            <object class="GtkLabel" id="tpw_hue_label">
-                             <property name="visible">True</property>
+                             <property name="visible" bind-source="tpw_hue_scale" bind-property="visible" 
bind-flags="default|sync-create"/>
                              <property name="label" translatable="yes">_Hue:</property>
                              <property name="use_underline">True</property>
                              <property name="use_markup">False</property>
diff --git a/src/totem-preferences.c b/src/totem-preferences.c
index 976d568db..c52fc1b67 100644
--- a/src/totem-preferences.c
+++ b/src/totem-preferences.c
@@ -274,8 +274,6 @@ totem_setup_preferences (Totem *totem)
                        item = POBJ (props[i].name);
                        gtk_range_set_value (GTK_RANGE (item), (gdouble) 65535/2);
                        gtk_widget_hide (GTK_WIDGET (item));
-                       item = POBJ (props[i].label);
-                       gtk_widget_hide (GTK_WIDGET (item));
                        hidden++;
                }
        }


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