[gnome-shell] dateMenu: Remove custom aligning of time strings in the World Clocks
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dateMenu: Remove custom aligning of time strings in the World Clocks
- Date: Thu, 7 Jul 2022 12:46:56 +0000 (UTC)
commit 2a3d409114bb995e96f0ea3f2537619a30c18ea9
Author: Maksym Hazevych <dpadar protonmail com>
Date: Mon Jun 20 17:43:09 2022 +0300
dateMenu: Remove custom aligning of time strings in the World Clocks
Since now Glib uses tabular space for aligning numbers (merged in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2698), there is no
more need for custom aligning.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5438
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2340>
js/ui/dateMenu.js | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index f3cb006139..bd363f3232 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -418,10 +418,7 @@ class WorldClocksSection extends St.Button {
x_expand: true,
});
- let time = new St.Label({
- style_class: 'world-clocks-time',
- x_align: Clutter.ActorAlign.END,
- });
+ let time = new St.Label({ style_class: 'world-clocks-time' });
const tz = new St.Label({
style_class: 'world-clocks-timezone',
@@ -487,25 +484,10 @@ class WorldClocksSection extends St.Button {
}
_updateTimeLabels() {
- let differentLength = false;
- let lastLength;
for (let i = 0; i < this._locations.length; i++) {
let l = this._locations[i];
const now = GLib.DateTime.new_now(l.location.get_timezone());
- const text = Util.formatTime(now, { timeOnly: true });
- l.timeLabel.text = text;
-
- if (differentLength)
- continue;
- if (lastLength === undefined)
- lastLength = text.length;
- differentLength = lastLength !== text.length;
- }
-
- for (let i = 0; i < this._locations.length; i++) {
- this._locations[i].timeLabel.x_align = differentLength
- ? Clutter.ActorAlign.START
- : Clutter.ActorAlign.END;
+ l.timeLabel.text = Util.formatTime(now, { timeOnly: true });
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]