[gnome-sound-recorder] Fix the margin in the toolbar in RTL



commit a99aa79cb21654bd7a739d9d7333fe2ded2fef95
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Fri Jan 24 02:30:22 2014 +0200

    Fix the margin in the toolbar in RTL
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722872
    
    Signed-off-by: Meg Ford <meg387 gmail com>

 data/application.css |    6 +++++-
 src/mainWindow.js    |    8 ++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/data/application.css b/data/application.css
index 2db5c68..ee485ea 100644
--- a/data/application.css
+++ b/data/application.css
@@ -22,6 +22,10 @@
   border-radius: 0px; 
 }
 
-.view .toolbarEnd {
+.view .toolbarEnd:dir(ltr) {
   border-left: rgba(255,255,255,0.45) 1px solid; 
 }
+
+.view .toolbarEnd:dir(rtl) {
+  border-right: rgba(255,255,255,0.45) 1px solid; 
+}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 4dffd11..5447590 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -364,6 +364,8 @@ const MainView = new Lang.Class({
                 this._group = new Gtk.ToolItem({ child: this._box, name: "PlayGroup"});
                 this.widget.insert(this._group, -1);
                 
+                let rtl = Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL;
+
                 // play button
                 this.playImage = Gtk.Image.new();
                 this.playImage.set_from_icon_name('media-playback-start-symbolic', Gtk.IconSize.BUTTON);
@@ -416,7 +418,8 @@ const MainView = new Lang.Class({
                                                  xalign: 0,
                                                  width_chars: 40,
                                                  margin_top: 5,
-                                                 margin_left: 15,
+                                                 margin_left: rtl ? 0 : 15,
+                                                 margin_right: rtl ? 15 : 0,
                                                  name: "FileNameLabel" });
                 let markup = ('<b>'+ this._files[i].fileName + '</b>');
                 this._fileName.label = markup;
@@ -430,7 +433,8 @@ const MainView = new Lang.Class({
                 this.rowGrid.attach(this._playLabelBox, 2, 1, 1, 1);
                 this._playLabelBox.show();
                         
-                this.playDurationLabel = new Gtk.Label({ margin_left: 15,
+                this.playDurationLabel = new Gtk.Label({ margin_left: rtl ? 0 : 15,
+                                                         margin_right: rtl ? 15 : 0,
                                                          halign: Gtk.Align.END,
                                                          valign: Gtk.Align.END,
                                                          margin_top: 5,


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