diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-15 21:37:49 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-15 21:55:26 +0100 |
commit | f277db6cb459c6e7456fb75722b9d57f734c4db6 (patch) | |
tree | eafe81136b237b4889623a0a0e7cf864250b689d /main/src/ui/util.vala | |
parent | 7ab4752b2438fac9c07745314f7cd428103f9b4c (diff) | |
download | dino-f277db6cb459c6e7456fb75722b9d57f734c4db6.tar.gz dino-f277db6cb459c6e7456fb75722b9d57f734c4db6.zip |
Display /me differently
fixes #12
Diffstat (limited to 'main/src/ui/util.vala')
-rw-r--r-- | main/src/ui/util.vala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/src/ui/util.vala b/main/src/ui/util.vala index 9ed28b1f..2cf070b0 100644 --- a/main/src/ui/util.vala +++ b/main/src/ui/util.vala @@ -105,6 +105,11 @@ public class Util : Object { public static void force_error_color(Gtk.Widget widget, string selector = "*") { force_color(widget, "@error_color", selector); } + + public static bool is_dark_theme(Gtk.Widget widget) { + Gdk.RGBA bg = widget.get_style_context().get_background_color(StateFlags.NORMAL); + return (bg.red < 0.5 && bg.green < 0.5 && bg.blue < 0.5); + } } }
\ No newline at end of file |