[gnome-control-center] display: Force LTR to the spinbuttons's box



commit 5a7aa11b1ec9a74ce3073c27e046035f2a118024
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Mon Feb 28 09:47:53 2022 +0000

    display: Force LTR to the spinbuttons's box

 panels/display/cc-night-light-page.c  | 10 ++++++++++
 panels/display/cc-night-light-page.ui |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/panels/display/cc-night-light-page.c b/panels/display/cc-night-light-page.c
index d46251675..14dc11f45 100644
--- a/panels/display/cc-night-light-page.c
+++ b/panels/display/cc-night-light-page.c
@@ -42,8 +42,10 @@ struct _CcNightLightPage {
   GtkWidget           *scale_color_temperature;
   GtkWidget           *night_light_toggle_switch;
   GtkComboBox         *schedule_type_combo;
+  GtkWidget           *from_spinbuttons_box;
   GtkWidget           *spinbutton_from_hours;
   GtkWidget           *spinbutton_from_minutes;
+  GtkWidget           *to_spinbuttons_box;
   GtkWidget           *spinbutton_to_hours;
   GtkWidget           *spinbutton_to_minutes;
   GtkStack            *stack_from;
@@ -592,8 +594,10 @@ cc_night_light_page_class_init (CcNightLightPageClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, night_light_toggle_switch);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, schedule_type_combo);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, scale_color_temperature);
+  gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, from_spinbuttons_box);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, spinbutton_from_hours);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, spinbutton_from_minutes);
+  gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, to_spinbuttons_box);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, spinbutton_to_hours);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, spinbutton_to_minutes);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, stack_from);
@@ -697,6 +701,12 @@ cc_night_light_page_init (CcNightLightPage *self)
                            G_CALLBACK (dialog_clock_settings_changed_cb),
                            self, G_CONNECT_SWAPPED);
 
+  if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+    {
+      gtk_widget_set_direction (self->to_spinbuttons_box, GTK_TEXT_DIR_LTR);
+      gtk_widget_set_direction (self->from_spinbuttons_box, GTK_TEXT_DIR_LTR);
+    }
+
   dialog_update_state (self);
 }
 
diff --git a/panels/display/cc-night-light-page.ui b/panels/display/cc-night-light-page.ui
index 300d93ec5..ba2f0bfbc 100644
--- a/panels/display/cc-night-light-page.ui
+++ b/panels/display/cc-night-light-page.ui
@@ -128,7 +128,7 @@
                           </object>
                         </child>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkBox" id="from_spinbuttons_box">
                             <property name="spacing">4</property>
                             <child>
                               <object class="GtkSpinButton" id="spinbutton_from_hours">
@@ -215,7 +215,7 @@
                           </object>
                         </child>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkBox" id="to_spinbuttons_box">
                             <property name="spacing">4</property>
                             <child>
                               <object class="GtkSpinButton" id="spinbutton_to_hours">


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