[gnome-clocks/wip/analogtimer] Set the direction of the grid to LTR in RTL mode and pertend RATIO char with LTR marks in the timer



commit 95e394274338a658bcfb293fab1025ebaf2b145c
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Mon Aug 12 09:44:16 2013 +0200

    Set the direction of the grid to LTR in RTL mode and pertend RATIO
    char with LTR marks in the timer label. Define grid_spinbuttons outside
    of the constructor as we plan to port Clocks.Timer.MainPanel to
    composite templates.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705305

 src/timer.vala |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/timer.vala b/src/timer.vala
index 4c5ab57..8b575ff 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -164,6 +164,7 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
     private uint timeout_id;
     private Utils.Bell bell;
     private Gtk.Widget setup_panel;
+    private Gtk.Grid grid_spinbuttons;
     private Gtk.SpinButton h_spinbutton;
     private Gtk.SpinButton m_spinbutton;
     private Gtk.SpinButton s_spinbutton;
@@ -196,11 +197,15 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
         setup_panel = builder.get_object ("setup_panel") as Gtk.Widget;
         setup_frame.add (setup_panel);
 
+        grid_spinbuttons = builder.get_object ("grid_spinbuttons") as Gtk.Grid;
         h_spinbutton = builder.get_object ("spinbutton_hours") as Gtk.SpinButton;
         m_spinbutton = builder.get_object ("spinbutton_minutes") as Gtk.SpinButton;
         s_spinbutton = builder.get_object ("spinbutton_seconds") as Gtk.SpinButton;
         start_button = builder.get_object ("start_button") as Gtk.Button;
 
+        // Force LTR since we do not want to reverse [hh] : [mm] : [ss]
+        grid_spinbuttons.set_direction (Gtk.TextDirection.LTR);
+
         h_spinbutton.output.connect (show_leading_zeros);
         m_spinbutton.output.connect (show_leading_zeros);
         s_spinbutton.output.connect (show_leading_zeros);
@@ -375,13 +380,15 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
     }
 
     private void update_countdown_label (int h, int m, int s) {
-        // Note that the format uses unicode RATIO character
-        countdown_label.set_text ("%02i∶%02i∶%02i".printf (h, m, s));
+        // Note that the format uses unicode RATIO character,
+        // which is prepended with a LTR mark
+        countdown_label.set_text ("%02i\xE2\x80\x8E∶%02i\xE2\x80\x8E∶%02i".printf (h, m, s));
     }
 
     private void update_countup_label (int h, int m, int s) {
-        // Note that the format uses unicode RATIO character
-        countup_label.set_text ("%02i∶%02i∶%02i".printf (h, m, s));
+        // Note that the format uses unicode RATIO character,
+        // which is prepended with a LTR mark
+        countup_label.set_text ("%02i\xE2\x80\x8E∶%02i\xE2\x80\x8E∶%02i".printf (h, m, s));
     }
 
     public override void grab_focus () {


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