[gnome-klotski/arnaudb/wip/gtk4: 47/62] Fix color init.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-klotski/arnaudb/wip/gtk4: 47/62] Fix color init.
- Date: Fri, 25 Sep 2020 16:27:13 +0000 (UTC)
commit 4b7e736aff9d13d946a9c36ab92ed37c77951fc9
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 814c226..9c586d4 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]