diff options
author | Michael Natterer <mitch@imendio.com> | 2007-02-05 14:11:39 +0000 |
---|---|---|
committer | Michael Natterer <mitch@src.gnome.org> | 2007-02-05 14:11:39 +0000 |
commit | 17fed85c24c8280217e4ebf6c75f691595abd887 (patch) | |
tree | 49a3da32c52f908883e87e4a4a475077d80fba38 /gtk/gtkaccellabel.c | |
parent | aca7e2316a79855f403ca3ed90772ae08e2dd8c8 (diff) | |
download | gtk+-17fed85c24c8280217e4ebf6c75f691595abd887.tar.gz |
add new boolean settings gtk-enable-accels and gtk-enable-mnemonics which
2007-02-05 Michael Natterer <mitch@imendio.com>
* gtk/gtksettings.c: add new boolean settings gtk-enable-accels
and gtk-enable-mnemonics which enable/disable accelerators and
mnemonics (bug #72375, based on a patch from Tommi Komulainen).
* gtk/gtkwindow.c (gtk_window_activate_key)
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): don't invoke them
if the resp. setting is FALSE.
* gtk/gtkaccellabel.c (gtk_accel_label_refetch)
* gtk/gtklabel.c (gtk_label_set_pattern_internal): don't display
them if the setting is FALSE.
* gtk/gtklabel.c: added signal connection to the screen's settings
object and traverse all widgets on the screen when the setting
changes. It's slightly ugly to also update GtkAccelLabels here,
but less ugly than connecting and traversing all widgets twice.
svn path=/trunk/; revision=17262
Diffstat (limited to 'gtk/gtkaccellabel.c')
-rw-r--r-- | gtk/gtkaccellabel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 5ea999499a..6a7bf1eda5 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -664,6 +664,8 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass, gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label) { + gboolean enable_accels; + g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE); if (accel_label->accel_string) @@ -672,7 +674,11 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label) accel_label->accel_string = NULL; } - if (accel_label->accel_closure) + g_object_get (gtk_widget_get_settings (GTK_WIDGET (accel_label)), + "gtk-enable-accels", &enable_accels, + NULL); + + if (enable_accels && accel_label->accel_closure) { GtkAccelKey *key = gtk_accel_group_find (accel_label->accel_group, find_accel, accel_label->accel_closure); |