[gtk+/wip/matthiasc/help-overlay] shortcuts: Add mnemonics for pages
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/help-overlay] shortcuts: Add mnemonics for pages
- Date: Wed, 21 Oct 2015 04:15:36 +0000 (UTC)
commit f674b26d80662cc2bce4fc73deef50b1f9edcef8
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 20 22:20:18 2015 -0400
shortcuts: Add mnemonics for pages
Allow Alt-1, Alt-2 and so forth, to switch pages in the shortcuts
window.
gtk/gtkshortcutssection.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index ebd4bf9..c373e9d 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -22,6 +22,7 @@
#include "gtkshortcutsgroup.h"
#include "gtkbutton.h"
+#include "gtklabel.h"
#include "gtkstack.h"
#include "gtkstackswitcher.h"
#include "gtkstylecontext.h"
@@ -436,12 +437,17 @@ static void
adjust_page_buttons (GtkWidget *widget,
gpointer data)
{
+ GtkWidget *label;
+
/*
* TODO: This is a hack to get the GtkStackSwitcher radio
* buttons to look how we want. However, it's very
* much font size specific.
*/
gtk_widget_set_size_request (widget, 34, 34);
+
+ label = gtk_bin_get_child (GTK_BIN (widget));
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
}
static void
@@ -598,7 +604,7 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
GtkWidget *page = p->data;
gchar *title;
- title = g_strdup_printf ("%u", n_pages + 1);
+ title = g_strdup_printf ("_%u", n_pages + 1);
gtk_stack_add_titled (self->stack, page, title, title);
g_free (title);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]