diff --git a/ChangeLog b/ChangeLog index 7123422f16b4eaa36ec6088f6d7d7469d2f41553..a0dc0ec10606ae5c3311891eef65bd6afb9a5af1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-04 Benedikt Meurer <benny@xfce.org> + + * thunar/thunar-icon-renderer.c(thunar_icon_renderer_render): Generate + the colorized/spotlighted version of the icon only if the icon area + is affected by expose event. + 2005-09-04 Benedikt Meurer <benny@xfce.org> * thunar-vfs/thunar-vfs-uri.c(escape): And of course, we need to escape diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c index b99771d93e65bc9d8ada41f0647873038726c65e..658e0731b0006c47cd4878d2dbd6a7ab9a2754ce 100644 --- a/thunar/thunar-icon-renderer.c +++ b/thunar/thunar-icon-renderer.c @@ -365,31 +365,32 @@ thunar_icon_renderer_render (GtkCellRenderer *renderer, icon_area.height = gdk_pixbuf_get_height (icon); } - /* colorize the icon if we should follow the selection state */ - if ((flags & (GTK_CELL_RENDERER_SELECTED | GTK_CELL_RENDERER_PRELIT)) != 0 && icon_renderer->follow_state) + icon_area.x = cell_area->x + (cell_area->width - icon_area.width) / 2; + icon_area.y = cell_area->y + (cell_area->height - icon_area.height) / 2; + + /* check whether the icon is affected by the expose event */ + if (gdk_rectangle_intersect (expose_area, &icon_area, &draw_area)) { - if ((flags & GTK_CELL_RENDERER_SELECTED) != 0) + /* colorize the icon if we should follow the selection state */ + if ((flags & (GTK_CELL_RENDERER_SELECTED | GTK_CELL_RENDERER_PRELIT)) != 0 && icon_renderer->follow_state) { - state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE; - temp = thunarx_gdk_pixbuf_colorize (icon, &widget->style->base[state]); - g_object_unref (G_OBJECT (icon)); - icon = temp; - } + if ((flags & GTK_CELL_RENDERER_SELECTED) != 0) + { + state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE; + temp = thunarx_gdk_pixbuf_colorize (icon, &widget->style->base[state]); + g_object_unref (G_OBJECT (icon)); + icon = temp; + } - if ((flags & GTK_CELL_RENDERER_PRELIT) != 0) - { - temp = thunarx_gdk_pixbuf_spotlight (icon); - g_object_unref (G_OBJECT (icon)); - icon = temp; + if ((flags & GTK_CELL_RENDERER_PRELIT) != 0) + { + temp = thunarx_gdk_pixbuf_spotlight (icon); + g_object_unref (G_OBJECT (icon)); + icon = temp; + } } - } - icon_area.x = cell_area->x + (cell_area->width - icon_area.width) / 2; - icon_area.y = cell_area->y + (cell_area->height - icon_area.height) / 2; - - if (gdk_rectangle_intersect (cell_area, &icon_area, &draw_area) - && gdk_rectangle_intersect (expose_area, &icon_area, &draw_area)) - { + /* render the invalid parts of the icon */ gdk_draw_pixbuf (window, widget->style->black_gc, icon, draw_area.x - icon_area.x, draw_area.y - icon_area.y, draw_area.x, draw_area.y, draw_area.width, draw_area.height,