MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / getDefaultLightPalette

Method getDefaultLightPalette

src/utils/StyleHelper.cpp:106–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106QPalette StyleHelper::getDefaultLightPalette() {
107 const bool darkAppearance = false;
108 const QColor windowText = darkAppearance ? QColor(240, 240, 240) : Qt::black;
109 const QColor backGround = darkAppearance ? QColor(50, 50, 50) : QColor(239, 239, 239);
110 const QColor light = backGround.lighter(150);
111 const QColor mid = (backGround.darker(130));
112 const QColor midLight = mid.lighter(110);
113 const QColor base = darkAppearance ? backGround.darker(140) : Qt::white;
114 const QColor disabledBase(backGround);
115 const QColor dark = backGround.darker(150);
116 const QColor darkDisabled = QColor(209, 209, 209).darker(110);
117 const QColor text = darkAppearance ? windowText : Qt::black;
118 const QColor highlight = QColor(48, 140, 198);
119 const QColor hightlightedText = darkAppearance ? windowText : Qt::white;
120 const QColor disabledText = darkAppearance ? QColor(130, 130, 130) : QColor(190, 190, 190);
121 const QColor button = backGround;
122 const QColor shadow = dark.darker(135);
123 const QColor disabledShadow = shadow.lighter(150);
124 QColor placeholder = text;
125 placeholder.setAlpha(128);
126
127 QPalette fusionPalette(windowText, backGround, light, dark, mid, text, base);
128 fusionPalette.setBrush(QPalette::Midlight, midLight);
129 fusionPalette.setBrush(QPalette::Button, button);
130 fusionPalette.setBrush(QPalette::Shadow, shadow);
131 fusionPalette.setBrush(QPalette::HighlightedText, hightlightedText);
132
133 fusionPalette.setBrush(QPalette::Disabled, QPalette::Text, disabledText);
134 fusionPalette.setBrush(QPalette::Disabled, QPalette::WindowText, disabledText);
135 fusionPalette.setBrush(QPalette::Disabled, QPalette::ButtonText, disabledText);
136 fusionPalette.setBrush(QPalette::Disabled, QPalette::Base, disabledBase);
137 fusionPalette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled);
138 fusionPalette.setBrush(QPalette::Disabled, QPalette::Shadow, disabledShadow);
139
140 fusionPalette.setBrush(QPalette::Active, QPalette::Highlight, highlight);
141 fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, highlight);
142 fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 145, 145));
143
144 fusionPalette.setBrush(QPalette::PlaceholderText, placeholder);
145
146 // Use a more legible light blue on dark backgrounds than the default Qt::blue.
147 if (darkAppearance)
148 fusionPalette.setBrush(QPalette::Link, highlight);
149
150 return fusionPalette;
151}
152
153void StyleHelper::loadIcons(bool white)
154{

Callers

nothing calls this directly

Calls 3

QColorClass · 0.85
setAlphaMethod · 0.80
setBrushMethod · 0.80

Tested by

no test coverage detected