GH-1711 fix inactive element shading in Dark and Bright themes
This commit is contained in:
32
application/themes/FusionTheme.cpp
Normal file
32
application/themes/FusionTheme.cpp
Normal file
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user