[gtk+] cellrenderertoggle: Use "check" and "radio" names
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cellrenderertoggle: Use "check" and "radio" names
- Date: Mon, 15 Feb 2016 03:45:54 +0000 (UTC)
commit beb76936d9f562fbaed46fc6eb22957733aa8b36
Author: Benjamin Otte <otte gnome org>
Date: Mon Feb 15 04:40:03 2016 +0100
cellrenderertoggle: Use "check" and "radio" names
... instead of just adding a style class.
gtk/gtkcellrenderertoggle.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 282d8f0..079d64b 100644
--- a/gtk/gtkcellrenderertoggle.c
+++ b/gtk/gtkcellrenderertoggle.c
@@ -21,6 +21,7 @@
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
+#include "gtkstylecontextprivate.h"
#include "gtktreeprivate.h"
#include "a11y/gtkbooleancellaccessible.h"
@@ -399,27 +400,28 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
gdk_cairo_rectangle (cr, cell_area);
cairo_clip (cr);
- gtk_style_context_save (context);
- gtk_style_context_set_state (context, state);
if (priv->radio)
{
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_RADIO);
+ gtk_style_context_save_named (context, "radio");
+ gtk_style_context_set_state (context, state);
gtk_render_option (context, cr,
cell_area->x + x_offset + xpad,
cell_area->y + y_offset + ypad,
width, height);
+ gtk_style_context_restore (context);
}
else
{
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
+ gtk_style_context_save_named (context, "check");
+ gtk_style_context_set_state (context, state);
gtk_render_check (context, cr,
cell_area->x + x_offset + xpad,
cell_area->y + y_offset + ypad,
width, height);
+ gtk_style_context_restore (context);
}
- gtk_style_context_restore (context);
cairo_restore (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]