[gtk+/gtk-3-8] GtkCheckMenuItem: remove an unused boolean field
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] GtkCheckMenuItem: remove an unused boolean field
- Date: Thu, 9 May 2013 17:03:05 +0000 (UTC)
commit 6ff37b070b69269e5c08cc5f82cfd66dfdcf1726
Author: Ryan Lortie <desrt desrt ca>
Date: Wed May 8 08:15:40 2013 -0400
GtkCheckMenuItem: remove an unused boolean field
always_show_toggle was always set to TRUE in _init() and never changed
from anywhere else. Remove it and remove the if() statements based on
it.
https://bugzilla.gnome.org/show_bug.cgi?id=699929
gtk/gtkcheckmenuitem.c | 49 ++++++++++++++++++++---------------------------
1 files changed, 21 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index 343565d..4198660 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -53,7 +53,6 @@
struct _GtkCheckMenuItemPrivate
{
guint active : 1;
- guint always_show_toggle : 1;
guint draw_as_radio : 1;
guint inconsistent : 1;
};
@@ -467,7 +466,6 @@ gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
priv = check_menu_item->priv;
priv->active = FALSE;
- priv->always_show_toggle = TRUE;
}
static gint
@@ -556,34 +554,29 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
y = (allocation.height - indicator_size) / 2;
- if (priv->active ||
- priv->always_show_toggle ||
- (state & GTK_STATE_FLAG_PRELIGHT))
+ gtk_style_context_save (context);
+
+ if (priv->inconsistent)
+ state |= GTK_STATE_FLAG_INCONSISTENT;
+ else if (priv->active)
+ state |= GTK_STATE_FLAG_ACTIVE;
+
+ gtk_style_context_set_state (context, state);
+
+ if (priv->draw_as_radio)
{
- gtk_style_context_save (context);
-
- if (priv->inconsistent)
- state |= GTK_STATE_FLAG_INCONSISTENT;
- else if (priv->active)
- state |= GTK_STATE_FLAG_ACTIVE;
-
- gtk_style_context_set_state (context, state);
-
- if (priv->draw_as_radio)
- {
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_RADIO);
- gtk_render_option (context, cr, x, y,
- indicator_size, indicator_size);
- }
- else
- {
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
- gtk_render_check (context, cr, x, y,
- indicator_size, indicator_size);
- }
-
- gtk_style_context_restore (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_RADIO);
+ gtk_render_option (context, cr, x, y,
+ indicator_size, indicator_size);
}
+ else
+ {
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
+ gtk_render_check (context, cr, x, y,
+ indicator_size, indicator_size);
+ }
+
+ gtk_style_context_restore (context);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]