[gnome-shell] calendar: Allow keynav to day headers and week numbers



commit afc2253e5d886b3b9fe537cdcab8485c7ed534b1
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Mar 3 04:37:49 2015 +0100

    calendar: Allow keynav to day headers and week numbers
    
    While those elements cannot be activated, they still provide useful
    information to screen readers, so include them in the focus chain.
    For the same purpose, set a more verbose accessible name, given that
    it is not bound by the same space constraints as the visible label.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706903

 js/ui/calendar.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index e325a8d..36c368b 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -615,7 +615,9 @@ const Calendar = new Lang.Class({
             // and we want, ideally, a single character for e.g. S M T W T F S
             let customDayAbbrev = _getCalendarDayAbbreviation(iter.getDay());
             let label = new St.Label({ style_class: 'calendar-day-base calendar-day-heading',
-                                       text: customDayAbbrev });
+                                       text: customDayAbbrev,
+                                       can_focus: true });
+            label.accessible_name = iter.toLocaleFormat('%A');
             let col;
             if (this.actor.get_text_direction() == Clutter.TextDirection.RTL)
                 col = 6 - (7 + iter.getDay() - this._weekStart) % 7;
@@ -800,7 +802,10 @@ const Calendar = new Lang.Class({
 
             if (this._useWeekdate && iter.getDay() == 4) {
                 let label = new St.Label({ text: iter.toLocaleFormat('%V'),
-                                           style_class: 'calendar-day-base calendar-week-number'});
+                                           style_class: 'calendar-day-base calendar-week-number',
+                                           can_focus: true });
+                let weekFormat = Shell.util_translate_time_string(N_("Week %V"));
+                label.accessible_name = iter.toLocaleFormat(weekFormat);
                 layout.pack(label, rtl ? 7 : 0, row);
             }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]