diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-05 15:51:51 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-06 00:17:02 +0100 |
commit | 13b575f7a90ef97f3b30f2a2f74bd19d58d375e7 (patch) | |
tree | 4fffdae5bc645bd57d072bf5c3581a2b7613abc8 /application/themes/FusionTheme.cpp | |
parent | 495e752f8aef2774702890b8edc93de592c66984 (diff) | |
download | MultiMC-13b575f7a90ef97f3b30f2a2f74bd19d58d375e7.tar MultiMC-13b575f7a90ef97f3b30f2a2f74bd19d58d375e7.tar.gz MultiMC-13b575f7a90ef97f3b30f2a2f74bd19d58d375e7.tar.lz MultiMC-13b575f7a90ef97f3b30f2a2f74bd19d58d375e7.tar.xz MultiMC-13b575f7a90ef97f3b30f2a2f74bd19d58d375e7.zip |
GH-1711 fix inactive element shading in Dark and Bright themes
Diffstat (limited to 'application/themes/FusionTheme.cpp')
-rw-r--r-- | application/themes/FusionTheme.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/application/themes/FusionTheme.cpp b/application/themes/FusionTheme.cpp new file mode 100644 index 00000000..fa2ccf64 --- /dev/null +++ b/application/themes/FusionTheme.cpp @@ -0,0 +1,32 @@ +#include "FusionTheme.h" +#include "rainbow.h" + +QString FusionTheme::qtTheme() +{ + return "Fusion"; +} + +QPalette FusionTheme::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; +} + |