[gnome-shell] calendar: Fix grid lines in RTL locales
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] calendar: Fix grid lines in RTL locales
- Date: Sat, 14 Jul 2012 21:28:13 +0000 (UTC)
commit fe69ea305baee9fc0c96afc654bd5bfb957897aa
Author: Florian MÃllner <fmuellner gnome org>
Date: Fri Jul 13 19:00:56 2012 +0200
calendar: Fix grid lines in RTL locales
The calendar grid is build by giving each element right and bottom
borders, all top-most elements a top border, and all left-most
elements a left border. However in RTL locales, we currently add
the left border to the *right-most* elements, resulting in the grid
appearing clipped on the left side.
https://bugzilla.gnome.org/show_bug.cgi?id=679879
js/ui/calendar.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index c29828b..fc01ca5 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -551,6 +551,7 @@ const Calendar = new Lang.Class({
let row = 2;
while (true) {
let button = new St.Button({ label: iter.getDate().toString() });
+ let rtl = button.get_text_direction() == Clutter.TextDirection.RTL;
if (!this._eventSource)
button.reactive = false;
@@ -571,7 +572,10 @@ const Calendar = new Lang.Class({
// Hack used in lieu of border-collapse - see gnome-shell.css
if (row == 2)
styleClass = 'calendar-day-top ' + styleClass;
- if (iter.getDay() == this._weekStart)
+
+ let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
+ : iter.getDay() == this._weekStart;
+ if (leftMost)
styleClass = 'calendar-day-left ' + styleClass;
if (_sameDay(now, iter))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]