[gnome-klotski/arnaudb/wip/gtk4: 10/14] Fix color init.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-klotski/arnaudb/wip/gtk4: 10/14] Fix color init.
- Date: Tue, 24 Mar 2020 14:15:44 +0000 (UTC)
commit 246e44ee607306f92e0903ee53e675153c52672b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Mar 6 01:15:49 2020 +0100
Fix color init.
src/puzzle-view.vala | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/puzzle-view.vala b/src/puzzle-view.vala
index d3e87c6..fc47b94 100644
--- a/src/puzzle-view.vala
+++ b/src/puzzle-view.vala
@@ -143,8 +143,10 @@ private class PuzzleView : Gtk.DrawingArea
style_context.save ();
style_context.set_state (Gtk.StateFlags.NORMAL);
- Gdk.RGBA fg = style_context.get_color (Gtk.StateFlags.NORMAL);
- Gdk.RGBA bg = style_context.get_background_color (Gtk.StateFlags.NORMAL);
+ Gdk.RGBA fg = style_context.get_color ();
+ Gdk.RGBA bg;
+ if (!style_context.lookup_color ("theme_bg_color", out bg))
+ bg = { /* 246 */ 0.9647f, /* 245 */ 0.9608f, /* 244 */ 0.9569f, 1.0f }; // #f6f5f4 is
Adwaita-light bg_color
style_context.restore ();
Gdk.cairo_set_source_rgba (cr, bg);
@@ -188,7 +190,9 @@ private class PuzzleView : Gtk.DrawingArea
style_context.save ();
style_context.set_state (Gtk.StateFlags.NORMAL);
- Gdk.RGBA bg = style_context.get_background_color (Gtk.StateFlags.NORMAL);
+ Gdk.RGBA bg;
+ if (!style_context.lookup_color ("theme_bg_color", out bg))
+ bg = { /* 246 */ 0.9647f, /* 245 */ 0.9608f, /* 244 */ 0.9569f, 1.0f }; // #f6f5f4 is
Adwaita-light bg_color
style_context.restore ();
Gdk.cairo_rectangle (cr, rect);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]