[gnome-shell] calendar.js: switch buttons direction in RTL mode
- From: Dan Winship <danw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] calendar.js: switch buttons direction in RTL mode
- Date: Wed, 20 Jan 2010 22:25:44 +0000 (UTC)
commit 7bb14bd8da556ae44267a388ca237ac6c805e301
Author: Abderrahim Kitouni <a kitouni gmail com>
Date: Fri Dec 25 09:34:40 2009 +0100
calendar.js: switch buttons direction in RTL mode
also don't hang if translation of 'calendar:week_start:0' is incorrect
https://bugzilla.gnome.org/show_bug.cgi?id=584662
js/ui/calendar.js | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index d8b380a..81673c7 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -31,7 +31,7 @@ Calendar.prototype = {
if (isNaN(this._weekStart) || this._weekStart < 0 || this._weekStart > 6) {
log("Translation of 'calendar:week_start:0' in GTK+ is not correct");
- this.weekStart = 0;
+ this._weekStart = 0;
}
// Find the ordering for month/year in the calendar heading
@@ -63,14 +63,19 @@ Calendar.prototype = {
this.actor.add(this._topBox,
{ row: 0, col: 0, col_span: 7 });
- let back = new St.Button({ label: "<", style_class: 'calendar-change-month' });
+ let [backlabel, forwardlabel] = ["<", ">"];
+ if (St.Widget.get_default_direction () == St.TextDirection.RTL) {
+ [backlabel, forwardlabel] = [forwardlabel, backlabel];
+ }
+
+ let back = new St.Button({ label: backlabel, style_class: 'calendar-change-month' });
this._topBox.add(back);
back.connect("clicked", Lang.bind(this, this._prevMonth));
this._dateLabel = new St.Label();
this._topBox.add(this._dateLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
- let forward = new St.Button({ label: ">", style_class: 'calendar-change-month' });
+ let forward = new St.Button({ label: forwardlabel, style_class: 'calendar-change-month' });
this._topBox.add(forward);
forward.connect("clicked", Lang.bind(this, this._nextMonth));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]