From bc753859b5ab5d1402940024c0478548165b57f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 6 Nov 2016 04:29:12 +0100 Subject: GH-378 add basic custom theme support Files you can customize are created in themes/custom/ --- application/themes/ITheme.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 application/themes/ITheme.cpp (limited to 'application/themes/ITheme.cpp') diff --git a/application/themes/ITheme.cpp b/application/themes/ITheme.cpp new file mode 100644 index 00000000..aefcc381 --- /dev/null +++ b/application/themes/ITheme.cpp @@ -0,0 +1,26 @@ +#include "ITheme.h" +#include "rainbow.h" + +QPalette ITheme::fadeInactive(QPalette in, qreal bias, QColor color) +{ + auto blend = [&in, bias, color](QPalette::ColorRole role) + { + QColor from = in.color(QPalette::Active, role); + QColor blended = Rainbow::mix(from, color, bias); + in.setColor(QPalette::Disabled, role, blended); + }; + blend(QPalette::Window); + blend(QPalette::WindowText); + blend(QPalette::Base); + blend(QPalette::AlternateBase); + blend(QPalette::ToolTipBase); + blend(QPalette::ToolTipText); + blend(QPalette::Text); + blend(QPalette::Button); + blend(QPalette::ButtonText); + blend(QPalette::BrightText); + blend(QPalette::Link); + blend(QPalette::Highlight); + blend(QPalette::HighlightedText); + return in; +} -- cgit v1.2.3