switch to dark theme for dark colors

This commit is contained in:
Artem Anufrij 2017-11-09 20:09:10 +01:00
parent f0ecf5e173
commit e37362bd5a

View file

@ -42,6 +42,10 @@ namespace Webpin {
this.desktop_file = desktop_file;
this.events |= Gdk.EventMask.STRUCTURE_MASK;
if (desktop_file.color != null) {
var mid = desktop_file.color.red + desktop_file.color.blue + desktop_file.color.green;
if (mid / 3 < 0.3) {
Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
}
Granite.Widgets.Utils.set_color_primary (this, desktop_file.color);
}