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
This commit is contained in:
parent
ed75f0da63
commit
7bb14bd8da
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user