calendar: Vertically center align week numbers

The labels were previously aligned by using top-padding, which was
relative to font-size, and therefore didn't always align the text
correctly when font scaling was enabled.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1415
This commit is contained in:
Joonas Henriksson 2020-08-17 17:15:25 +03:00
parent 2fc6384bca
commit b1f4ac10da
No known key found for this signature in database
GPG Key ID: FAEDBC4FB5AA3B17
2 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,6 @@
height: 1.8em;
width: 2.3em;
border-radius: 2px;
padding: 0.5em 0 0;
margin: 6px;
background-color: darken($bg_color, 2%);
color: lighten($fg_color, 5%);

View File

@ -680,6 +680,7 @@ var Calendar = GObject.registerClass({
style_class: 'calendar-day-base calendar-week-number',
can_focus: true });
let weekFormat = Shell.util_translate_time_string(N_("Week %V"));
label.clutter_text.y_align = Clutter.ActorAlign.CENTER;
label.accessible_name = iter.toLocaleFormat(weekFormat);
layout.attach(label, rtl ? 7 : 0, row, 1, 1);
}