[gthumb] preserve the style context using save and restore



commit d256538e48a0d9befe82e910f89fb3b8b934042c
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Apr 6 15:19:30 2016 +0200

    preserve the style context using save and restore

 gthumb/gth-grid-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-grid-view.c b/gthumb/gth-grid-view.c
index bebf8ad..e10fff5 100644
--- a/gthumb/gth-grid-view.c
+++ b/gthumb/gth-grid-view.c
@@ -1506,8 +1506,9 @@ _gth_grid_view_item_draw_caption (GthGridViewItem *item,
                return;
 
        cairo_save (cr);
-
        style_context = gtk_widget_get_style_context (widget);
+       gtk_style_context_save (style_context);
+
        gtk_style_context_get_color (style_context, item_state, &color);
        gdk_cairo_set_source_rgba (cr, &color);
        cairo_move_to (cr, item->caption_area.x, item->caption_area.y + grid_view->priv->caption_padding);
@@ -1522,6 +1523,7 @@ _gth_grid_view_item_draw_caption (GthGridViewItem *item,
                                  item->caption_area.width,
                                  item->caption_area.height);
 
+       gtk_style_context_restore (style_context);
        cairo_restore (cr);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]