Fix a11y/keynav issues in info panel

Add mnemonics for all active controls.

Part of bug 650132
This commit is contained in:
Matthias Clasen 2011-05-15 18:53:24 -04:00
parent 4afbbe7265
commit f783f3cfdc
2 changed files with 34 additions and 20 deletions

View file

@ -899,6 +899,8 @@ info_panel_setup_graphics (CcInfoPanel *self)
switch_fallback_set_mapping, self, NULL);
gtk_box_pack_start (GTK_BOX (widget), GTK_WIDGET (sw), FALSE, FALSE, 0);
gtk_widget_show_all (GTK_WIDGET (sw));
widget = WID ("fallback-label");
gtk_label_set_mnemonic_widget (GTK_LABEL (widget), GTK_WIDGET (sw));
}
static void
@ -937,6 +939,7 @@ default_app_changed (GtkAppChooserButton *button,
static void
info_panel_setup_default_app (CcInfoPanel *self,
const char *content_type,
const char *label_id,
guint left_attach,
guint right_attach,
guint top_attach,
@ -946,6 +949,7 @@ info_panel_setup_default_app (CcInfoPanel *self,
GtkWidget *table;
GAppInfo *info;
GError *error = NULL;
GtkWidget *label;
table = WID ("default_apps_table");
@ -970,27 +974,30 @@ info_panel_setup_default_app (CcInfoPanel *self,
g_signal_connect (G_OBJECT (button), "changed",
G_CALLBACK (default_app_changed), self);
gtk_widget_show (button);
label = WID(label_id);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
}
static void
info_panel_setup_default_apps (CcInfoPanel *self)
{
info_panel_setup_default_app (self, "x-scheme-handler/http",
info_panel_setup_default_app (self, "x-scheme-handler/http", "web-label",
1, 2, 0, 1);
info_panel_setup_default_app (self, "x-scheme-handler/mailto",
info_panel_setup_default_app (self, "x-scheme-handler/mailto", "mail-label",
1, 2, 1, 2);
info_panel_setup_default_app (self, "text/calendar",
info_panel_setup_default_app (self, "text/calendar", "calendar-label",
1, 2, 2, 3);
info_panel_setup_default_app (self, "audio/x-vorbis+ogg",
info_panel_setup_default_app (self, "audio/x-vorbis+ogg", "music-label",
1, 2, 3, 4);
info_panel_setup_default_app (self, "video/x-ogm+ogg",
info_panel_setup_default_app (self, "video/x-ogm+ogg", "video-label",
1, 2, 4, 5);
info_panel_setup_default_app (self, "image/jpeg",
info_panel_setup_default_app (self, "image/jpeg", "photos-label",
1, 2, 5, 6);
}

View file

@ -417,19 +417,21 @@
<property name="column_spacing">12</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label20">
<object class="GtkLabel" id="web-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Web</property>
<property name="label" translatable="yes">_Web</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label21">
<object class="GtkLabel" id="mail-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Mail</property>
<property name="label" translatable="yes">_Mail</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="top_attach">1</property>
@ -437,11 +439,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="label22">
<object class="GtkLabel" id="calendar-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Calendar</property>
<property name="label" translatable="yes">_Calendar</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="top_attach">2</property>
@ -449,11 +452,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="label23">
<object class="GtkLabel" id="music-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Music</property>
<property name="label" translatable="yes">M_usic</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="top_attach">3</property>
@ -461,11 +465,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="label24">
<object class="GtkLabel" id="video-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Video</property>
<property name="label" translatable="yes">_Video</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="top_attach">4</property>
@ -541,11 +546,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="label32">
<object class="GtkLabel" id="photos-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Photos</property>
<property name="label" translatable="yes">_Photos</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="top_attach">5</property>
@ -653,11 +659,12 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="label16">
<object class="GtkLabel" id="fallback-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes" comments="Hardware is not able to run GNOME 3's shell, so we might want to force running the 'Fallback' experience.">Forced Fallback Mode</property>
<property name="label" translatable="yes" comments="Hardware is not able to run GNOME 3's shell, so we might want to force running the 'Fallback' experience.">Forced _Fallback Mode</property>
<property name="use_underline">True</property>
<property name="justify">right</property>
<style>
<class name="dim-label"/>