[baobab] Treemap: set the state in the style context
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Treemap: set the state in the style context
- Date: Tue, 15 Dec 2015 21:47:23 +0000 (UTC)
commit 9f077aff9fc54b0b59d0bd31367e185c164fbf9a
Author: Stefano Facchini <stefano facchini gmail com>
Date: Tue Dec 15 21:30:36 2015 +0100
Treemap: set the state in the style context
src/baobab-treemap.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-treemap.vala b/src/baobab-treemap.vala
index f134424..2788a3e 100644
--- a/src/baobab-treemap.vala
+++ b/src/baobab-treemap.vala
@@ -59,12 +59,14 @@ namespace Baobab {
uint border = ITEM_BORDER_WIDTH;
var context = get_style_context ();
+ context.save ();
+ context.set_state (Gtk.StateFlags.NORMAL);
cr.set_line_width (border);
cr.rectangle (x + border, y + border, width - border * 2, height - border * 2);
Gdk.cairo_set_source_rgba (cr, fill_color);
cr.fill_preserve ();
- var border_color = context.get_border_color (Gtk.StateFlags.NORMAL);
+ var border_color = context.get_border_color (context.get_state ());
Gdk.cairo_set_source_rgba (cr, border_color);
cr.stroke ();
@@ -81,6 +83,8 @@ namespace Baobab {
context.render_layout (cr, x + width / 2 - rect.width / 2, y + height / 2 - rect.height
/ 2, layout);
}
}
+
+ context.restore ();
}
protected override void draw_item (Cairo.Context cr, ChartItem item, bool highlighted) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]