[evince] [gimpcellrenderertoggle] Paint a shadow when the mouse is over the cell renderer
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] [gimpcellrenderertoggle] Paint a shadow when the mouse is over the cell renderer
- Date: Sat, 9 Oct 2010 14:57:46 +0000 (UTC)
commit 0a2d3c2d9dd1158dfb8cacd72abb498acd0e6fef
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat Oct 9 16:53:07 2010 +0200
[gimpcellrenderertoggle] Paint a shadow when the mouse is over the cell renderer
.../gimpcellrenderertoggle.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
index bfe5d22..e6a505f 100644
--- a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
+++ b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
@@ -285,6 +285,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
GtkStyle *style = gtk_widget_get_style (widget);
GdkRectangle toggle_rect;
GdkRectangle draw_rect;
+ GdkRectangle clip_rect;
GtkStateType state;
gboolean active;
gint xpad;
@@ -338,6 +339,23 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
state = GTK_STATE_INSENSITIVE;
}
+ if ((flags & GTK_CELL_RENDERER_PRELIT) &&
+ gdk_cairo_get_clip_rectangle(cr, &clip_rect) &&
+ gdk_rectangle_intersect (&clip_rect, cell_area, &draw_rect))
+ {
+ cairo_save (cr);
+ gdk_cairo_rectangle (cr, &draw_rect);
+ cairo_clip (cr);
+ gtk_paint_shadow (style,
+ cr,
+ state,
+ active ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
+ widget, NULL,
+ toggle_rect.x, toggle_rect.y,
+ toggle_rect.width, toggle_rect.height);
+ cairo_restore (cr);
+ }
+
if (active)
{
GdkPixbuf *insensitive = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]