4747#define DEFAULT_CAPTION_PADDING 2
4848#define DEFAULT_CELL_SPACING 16
4949#define DEFAULT_CELL_PADDING 5
50- #define DEFAULT_THUMBNAIL_BORDER 3
5150#define SCROLL_DELAY 30
5251#define LAYOUT_DELAY 20
5352#define RUBBERBAND_BORDER 2
@@ -152,7 +151,6 @@ struct _GthGridViewPrivate {
152151 int width ; /* size of the view */
153152 int height ;
154153 int thumbnail_size ;
155- int thumbnail_border ;
156154 int cell_size ; /* max size of any cell area */
157155 int cell_spacing ; /* vertical space and mininum horizontal space between adjacent cell areas */
158156 double cell_x_spacing ; /* horizontal space between adjacent cell areas (calculated automatically to fill the horizontal space uniformly). */
@@ -667,11 +665,11 @@ _gth_grid_view_update_item_size (GthGridView *self,
667665 switch (item -> style ) {
668666 case ITEM_STYLE_VIDEO :
669667 item -> thumbnail_area .width = item -> pixbuf_area .width ;
670- item -> thumbnail_area .height = thumbnail_size - ( self -> priv -> thumbnail_border * 2 ) ;
668+ item -> thumbnail_area .height = thumbnail_size ;
671669 break ;
672670 case ITEM_STYLE_IMAGE :
673- item -> thumbnail_area .width = item -> pixbuf_area .width + ( self -> priv -> thumbnail_border * 2 ) ;
674- item -> thumbnail_area .height = item -> pixbuf_area .height + ( self -> priv -> thumbnail_border * 2 ) ;
671+ item -> thumbnail_area .width = item -> pixbuf_area .width ;
672+ item -> thumbnail_area .height = item -> pixbuf_area .height ;
675673 break ;
676674 case ITEM_STYLE_ICON :
677675 item -> thumbnail_area .width = thumbnail_size ;
@@ -1300,7 +1298,6 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
13001298{
13011299 cairo_surface_t * image ;
13021300 GtkStyleContext * style_context ;
1303- cairo_rectangle_int_t frame_rect ;
13041301
13051302 image = item -> thumbnail ;
13061303 if (image == NULL )
@@ -1319,8 +1316,6 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
13191316 gtk_style_context_add_class (style_context , GTK_STYLE_CLASS_CELL );
13201317#endif
13211318
1322- frame_rect = item -> pixbuf_area ;
1323-
13241319 if ((item -> style == ITEM_STYLE_ICON )
13251320 || ! (item -> is_image || (item_state & GTK_STATE_FLAG_SELECTED ) || (item_state == GTK_STATE_FLAG_NORMAL )))
13261321 {
@@ -1365,8 +1360,6 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
13651360 }
13661361
13671362 if (item -> style == ITEM_STYLE_VIDEO ) {
1368- frame_rect = item -> thumbnail_area ;
1369-
13701363 _cairo_draw_film_background (cr ,
13711364 item -> thumbnail_area .x ,
13721365 item -> thumbnail_area .y ,
@@ -1389,34 +1382,6 @@ _gth_grid_view_item_draw_thumbnail (GthGridViewItem *item,
13891382 grid_view -> priv -> thumbnail_size );
13901383 }
13911384
1392- if ((item_state & GTK_STATE_FLAG_SELECTED ) || (item_state & GTK_STATE_FLAG_FOCUSED )) {
1393- #if GTK_CHECK_VERSION (3 , 20 , 0 )
1394- gtk_style_context_save (style_context );
1395- gtk_style_context_add_class (style_context , "icon-effect" );
1396- gtk_render_background (style_context ,
1397- cr ,
1398- frame_rect .x ,
1399- frame_rect .y ,
1400- frame_rect .width ,
1401- frame_rect .height );
1402- gtk_style_context_restore (style_context );
1403- #else
1404- GdkRGBA color ;
1405- gtk_style_context_get_background_color (style_context , item_state , & color );
1406- cairo_set_source_rgba (cr , color .red , color .green , color .blue , 0.5 );
1407- cairo_rectangle (cr ,
1408- frame_rect .x ,
1409- frame_rect .y ,
1410- frame_rect .width ,
1411- frame_rect .height );
1412- cairo_fill_preserve (cr );
1413-
1414- cairo_set_line_width (cr , 2 );
1415- cairo_set_source_rgb (cr , color .red , color .green , color .blue );
1416- cairo_stroke (cr );
1417- #endif
1418- }
1419-
14201385 gtk_style_context_restore (style_context );
14211386 cairo_restore (cr );
14221387
@@ -3476,7 +3441,7 @@ _gth_grid_view_set_thumbnail_size (GthGridView *self,
34763441 int size )
34773442{
34783443 self -> priv -> thumbnail_size = size ;
3479- self -> priv -> cell_size = self -> priv -> thumbnail_size + (self -> priv -> thumbnail_border * 2 ) + ( self -> priv -> cell_padding * 2 );
3444+ self -> priv -> cell_size = self -> priv -> thumbnail_size + (self -> priv -> cell_padding * 2 );
34803445 self -> priv -> update_caption_height = TRUE;
34813446 g_object_notify (G_OBJECT (self ), "thumbnail-size" );
34823447
@@ -3858,7 +3823,6 @@ gth_grid_view_init (GthGridView *self)
38583823 self -> priv -> width = 0 ;
38593824 self -> priv -> height = 0 ;
38603825 /* self->priv->thumbnail_size = 0; */
3861- self -> priv -> thumbnail_border = DEFAULT_THUMBNAIL_BORDER ;
38623826
38633827 /* self->priv->cell_size = 0; */
38643828 self -> priv -> cell_spacing = DEFAULT_CELL_SPACING ;
0 commit comments