[gimp/metadata-browser] libgimpwidgets: support GtkCellRendererToggle's "inconsistent" state
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] libgimpwidgets: support GtkCellRendererToggle's "inconsistent" state
- Date: Wed, 28 Sep 2011 10:51:11 +0000 (UTC)
commit 0bca43fed1c37f3f1859224f0866431d5eac0a55
Author: Michael Natterer <mitch gimp org>
Date: Fri Sep 23 23:42:09 2011 +0200
libgimpwidgets: support GtkCellRendererToggle's "inconsistent" state
and strike out GimpCellRendererToggle's icon in the inconsistent case.
libgimpwidgets/gimpcellrenderertoggle.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c
index 218fbd8..c18e922 100644
--- a/libgimpwidgets/gimpcellrenderertoggle.c
+++ b/libgimpwidgets/gimpcellrenderertoggle.c
@@ -368,7 +368,8 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (gdk_rectangle_intersect (&draw_rect, &toggle_rect, &draw_rect))
{
- cairo_t *cr = gdk_cairo_create (window);
+ cairo_t *cr = gdk_cairo_create (window);
+ gboolean inconsistent;
gdk_cairo_rectangle (cr, &draw_rect);
cairo_clip (cr);
@@ -377,6 +378,23 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
toggle_rect.x, toggle_rect.y);
cairo_paint (cr);
+ g_object_get (toggle,
+ "inconsistent", &inconsistent,
+ NULL);
+
+ if (inconsistent)
+ {
+ gdk_cairo_set_source_color (cr, &style->fg[state]);
+ cairo_set_line_width (cr, 2.0);
+ cairo_move_to (cr,
+ toggle_rect.x + toggle_rect.width,
+ toggle_rect.y);
+ cairo_line_to (cr,
+ toggle_rect.x,
+ toggle_rect.y + toggle_rect.height);
+ cairo_stroke (cr);
+ }
+
cairo_destroy (cr);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]