forked from AuroraMiddleware/gtk
More auto-mnemonics tweaks
When auto-mnemonics are on, hide mnemonics with insensitive target.
This commit is contained in:
parent
6f421d1450
commit
72e41b41f5
@ -1582,9 +1582,6 @@ mnemonics_visible_apply (GtkWidget *widget,
|
||||
|
||||
label = GTK_LABEL (widget);
|
||||
|
||||
if (!label->use_underline)
|
||||
return;
|
||||
|
||||
priv = GTK_LABEL_GET_PRIVATE (label);
|
||||
|
||||
mnemonics_visible = mnemonics_visible != FALSE;
|
||||
@ -2491,6 +2488,7 @@ gtk_label_set_pattern_internal (GtkLabel *label,
|
||||
GtkLabelPrivate *priv = GTK_LABEL_GET_PRIVATE (label);
|
||||
PangoAttrList *attrs;
|
||||
gboolean enable_mnemonics;
|
||||
gboolean auto_mnemonics;
|
||||
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
|
||||
@ -2499,10 +2497,14 @@ gtk_label_set_pattern_internal (GtkLabel *label,
|
||||
|
||||
g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
|
||||
"gtk-enable-mnemonics", &enable_mnemonics,
|
||||
"gtk-auto-mnemonics", &auto_mnemonics,
|
||||
NULL);
|
||||
|
||||
if (enable_mnemonics && priv->mnemonics_visible && pattern &&
|
||||
GTK_WIDGET_IS_SENSITIVE (label))
|
||||
(!auto_mnemonics ||
|
||||
(GTK_WIDGET_IS_SENSITIVE (label) &&
|
||||
(!label->mnemonic_widget ||
|
||||
GTK_WIDGET_IS_SENSITIVE (label->mnemonic_widget)))))
|
||||
attrs = gtk_label_pattern_to_attrs (label, pattern);
|
||||
else
|
||||
attrs = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user