[gthumb: 4/15] added a drop shadow effect to the video thumbnail as well
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 4/15] added a drop shadow effect to the video thumbnail as well
- Date: Wed, 23 Nov 2011 12:50:11 +0000 (UTC)
commit 32dc4c9e7cd9fcc40454fa42390fc5b4ccc462f7
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Nov 22 12:13:30 2011 +0100
added a drop shadow effect to the video thumbnail as well
gthumb/gth-grid-view.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/gthumb/gth-grid-view.c b/gthumb/gth-grid-view.c
index e9dd549..0487c2f 100644
--- a/gthumb/gth-grid-view.c
+++ b/gthumb/gth-grid-view.c
@@ -1084,6 +1084,9 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
GdkPixbuf *pixbuf;
GtkStyleContext *style_context;
cairo_rectangle_int_t frame_rect;
+ GdkRGBA background_color;
+ GdkRGBA lighter_color;
+ GdkRGBA darker_color;
pixbuf = item->thumbnail;
if (pixbuf == NULL)
@@ -1121,19 +1124,15 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
cairo_fill (cr);
}
+ gdk_rgba_parse (&background_color, "#edeceb");
+ gtk_style_context_get_background_color (style_context, item_state, &background_color);
+ _gdk_rgba_darker (&background_color, &lighter_color);
+ _gdk_rgba_darker (&lighter_color, &darker_color);
+
if (! item->is_icon && _g_mime_type_is_image (gth_file_data_get_mime_type (item->file_data))) {
/* ...draw a frame with a drop-shadow effect */
- GdkRGBA background_color;
- GdkRGBA lighter_color;
- GdkRGBA darker_color;
-
- gdk_rgba_parse (&background_color, "#edeceb");
- gtk_style_context_get_background_color (style_context, item_state, &background_color);
- _gdk_rgba_darker (&background_color, &lighter_color);
- _gdk_rgba_darker (&lighter_color, &darker_color);
-
cairo_translate (cr, 0.5, 0.5);
cairo_set_line_width (cr, 0.5);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
@@ -1210,6 +1209,16 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
frame_rect.width = item->pixbuf_area.width;
frame_rect.height = item->thumbnail_area.height - (grid_view->priv->thumbnail_border * 2);
+ /* the drop shadow */
+
+ gdk_cairo_set_source_rgba (cr, &darker_color);
+ cairo_rectangle (cr,
+ frame_rect.x + 2,
+ frame_rect.y + 2,
+ frame_rect.width,
+ frame_rect.height);
+ cairo_fill (cr);
+
/* dark background */
cairo_set_source_rgb (cr, 0.1, 0.1, 0.1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]