Gtk(Toggle)Button: preserve untouched state flags when updating state.
Partly fixes bug #640282, noticed by Christian Persch. buttons were clobbering the insensitive flag when updating their state.
This commit is contained in:
parent
74f7e08811
commit
a0e1fa9e77
@ -2298,7 +2298,7 @@ static void
|
|||||||
gtk_button_update_state (GtkButton *button)
|
gtk_button_update_state (GtkButton *button)
|
||||||
{
|
{
|
||||||
GtkButtonPrivate *priv = button->priv;
|
GtkButtonPrivate *priv = button->priv;
|
||||||
GtkStateFlags new_state = 0;
|
GtkStateFlags new_state;
|
||||||
gboolean depressed;
|
gboolean depressed;
|
||||||
|
|
||||||
if (priv->activate_timeout)
|
if (priv->activate_timeout)
|
||||||
@ -2306,6 +2306,9 @@ gtk_button_update_state (GtkButton *button)
|
|||||||
else
|
else
|
||||||
depressed = priv->in_button && priv->button_down;
|
depressed = priv->in_button && priv->button_down;
|
||||||
|
|
||||||
|
new_state = gtk_widget_get_state_flags (GTK_WIDGET (button)) &
|
||||||
|
~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
|
||||||
|
|
||||||
if (priv->in_button)
|
if (priv->in_button)
|
||||||
new_state |= GTK_STATE_FLAG_PRELIGHT;
|
new_state |= GTK_STATE_FLAG_PRELIGHT;
|
||||||
|
|
||||||
|
@ -563,6 +563,11 @@ gtk_toggle_button_update_state (GtkButton *button)
|
|||||||
"gtk-touchscreen-mode", &touchscreen,
|
"gtk-touchscreen-mode", &touchscreen,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
new_state = gtk_widget_get_state_flags (GTK_WIDGET (button)) &
|
||||||
|
~(GTK_STATE_FLAG_INCONSISTENT |
|
||||||
|
GTK_STATE_FLAG_PRELIGHT |
|
||||||
|
GTK_STATE_FLAG_ACTIVE);
|
||||||
|
|
||||||
if (priv->inconsistent)
|
if (priv->inconsistent)
|
||||||
new_state |= GTK_STATE_FLAG_INCONSISTENT;
|
new_state |= GTK_STATE_FLAG_INCONSISTENT;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user