Commit ba0542dc authored by Matthias Clasen's avatar Matthias Clasen

Allow applications to use gtk-enable-mnemonics in 3.12

gnome-terminal is still using this setting, so we'll let
applications override it for another cycle. It is no longer
backed by a system-wide setting, though, and it will still
go away eventually.

This partically reverts 7e3a494f
parent c3945d50
......@@ -1871,6 +1871,9 @@ gtk_label_screen_changed (GtkWidget *widget,
if (! shortcuts_connected)
{
g_signal_connect (settings, "notify::gtk-enable-mnemonics",
G_CALLBACK (label_shortcut_setting_changed),
NULL);
g_signal_connect (settings, "notify::gtk-enable-accels",
G_CALLBACK (label_shortcut_setting_changed),
NULL);
......@@ -2522,6 +2525,10 @@ gtk_label_set_markup_internal (GtkLabel *label,
gboolean enable_mnemonics = TRUE;
gboolean auto_mnemonics = TRUE;
g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
"gtk-enable-mnemonics", &enable_mnemonics,
NULL);
if (!(enable_mnemonics && priv->mnemonics_visible &&
(!auto_mnemonics ||
(gtk_widget_is_sensitive (GTK_WIDGET (label)) &&
......@@ -2737,6 +2744,10 @@ gtk_label_set_pattern_internal (GtkLabel *label,
if (is_mnemonic)
{
g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
"gtk-enable-mnemonics", &enable_mnemonics,
NULL);
if (enable_mnemonics && priv->mnemonics_visible && pattern &&
(!auto_mnemonics ||
(gtk_widget_is_sensitive (GTK_WIDGET (label)) &&
......
......@@ -955,6 +955,7 @@ gtk_menu_shell_key_press (GtkWidget *widget,
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
GtkMenuShellPrivate *priv = menu_shell->priv;
gboolean enable_mnemonics;
priv->keyboard_mode = TRUE;
......@@ -965,7 +966,14 @@ gtk_menu_shell_key_press (GtkWidget *widget,
if (gtk_bindings_activate_event (G_OBJECT (widget), event))
return TRUE;
return gtk_menu_shell_activate_mnemonic (menu_shell, event);
g_object_get (gtk_widget_get_settings (widget),
"gtk-enable-mnemonics", &enable_mnemonics,
NULL);
if (enable_mnemonics)
return gtk_menu_shell_activate_mnemonic (menu_shell, event);
return FALSE;
}
static gint
......
......@@ -1006,14 +1006,15 @@ gtk_settings_class_init (GtkSettingsClass *class)
*
* Since: 2.12
*
* Deprecated: 3.10: This setting is ignored
* Deprecated: 3.10: This setting can still be used for application
* overrides, but will be ignored in the future
*/
result = settings_install_property_parser (class,
g_param_spec_boolean ("gtk-enable-mnemonics",
P_("Enable Mnemonics"),
P_("Whether labels should have mnemonics"),
TRUE,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_ENABLE_MNEMONICS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment