css: Do inconsistent checked states right

In HTML5, both pseudoclasses apply. So we do the same thing in our
widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=733967
This commit is contained in:
Benjamin Otte 2014-08-14 05:14:36 +02:00
parent bb069b781b
commit 1abe923740
5 changed files with 9 additions and 5 deletions

View File

@ -390,7 +390,8 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (priv->inconsistent)
state |= GTK_STATE_FLAG_INCONSISTENT;
else if (priv->active)
if (priv->active)
state |= GTK_STATE_FLAG_CHECKED;
cairo_save (cr);

View File

@ -566,7 +566,8 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
if (gtk_toggle_button_get_inconsistent (toggle_button))
state |= GTK_STATE_FLAG_INCONSISTENT;
else if (gtk_toggle_button_get_active (toggle_button))
if (gtk_toggle_button_get_active (toggle_button))
state |= GTK_STATE_FLAG_CHECKED;
if (button->priv->activate_timeout || (button->priv->button_down && button->priv->in_button))

View File

@ -575,7 +575,7 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
if (priv->inconsistent)
state |= GTK_STATE_FLAG_INCONSISTENT;
else if (priv->active)
if (priv->active)
state |= GTK_STATE_FLAG_CHECKED;
gtk_style_context_set_state (context, state);

View File

@ -873,7 +873,8 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
if (gtk_toggle_button_get_inconsistent (toggle_button))
state |= GTK_STATE_FLAG_INCONSISTENT;
else if (gtk_toggle_button_get_active (toggle_button))
if (gtk_toggle_button_get_active (toggle_button))
state |= GTK_STATE_FLAG_CHECKED;
if (button->priv->activate_timeout ||

View File

@ -661,7 +661,8 @@ gtk_toggle_button_update_state (GtkButton *button)
if (priv->inconsistent)
new_state |= GTK_STATE_FLAG_INCONSISTENT;
else if (priv->active)
if (priv->active)
new_state |= GTK_STATE_FLAG_CHECKED;
if (button->priv->in_button && button->priv->button_down)