[gtk+] css: Do inconsistent checked states right
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] css: Do inconsistent checked states right
- Date: Sat, 16 Aug 2014 15:09:29 +0000 (UTC)
commit 1abe9237408e9ae65db91cc0b9593207d548adf6
Author: Benjamin Otte <otte redhat com>
Date: Thu Aug 14 05:14:36 2014 +0200
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
gtk/gtkcellrenderertoggle.c | 3 ++-
gtk/gtkcheckbutton.c | 3 ++-
gtk/gtkcheckmenuitem.c | 2 +-
gtk/gtkradiobutton.c | 3 ++-
gtk/gtktogglebutton.c | 3 ++-
5 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 64c01f2..282d8f0 100644
--- a/gtk/gtkcellrenderertoggle.c
+++ b/gtk/gtkcellrenderertoggle.c
@@ -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);
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index f395dcc..89ce961 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -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))
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index a326515..9e61306 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -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);
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index abf4e3c..6d3dec3 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -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 ||
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 193021b..1a0580e 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]