[gnome-shell] date-menu: Adjust boxpointer position for RTL locales



commit edc0cd36c51c99d75640b2d0abf8074cbb41e7a8
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 19 00:09:01 2011 +0100

    date-menu: Adjust boxpointer position for RTL locales
    
    We try to position the boxpointer centered above the calendar,
    which swaps position with the events list when using a RTL locale,
    so make the menu alignment dependent on the text direction.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=642721

 js/ui/dateMenu.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index dc2be15..9f6fb27 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -56,7 +56,10 @@ DateMenuButton.prototype = {
         //this._eventSource = new Calendar.FakeEventSource();
         this._eventSource = new Calendar.EvolutionEventSource();
 
-        PanelMenu.Button.prototype._init.call(this, 0.25);
+        let menuAlignment = 0.25;
+        if (St.Widget.get_default_direction() == St.TextDirection.RTL)
+            menuAlignment = 1.0 - menuAlignment;
+        PanelMenu.Button.prototype._init.call(this, menuAlignment);
 
         this._clock = new St.Label();
         this.actor.set_child(this._clock);



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