8#include "basictheme_p.h"
11#include <QGuiApplication>
14#include "libs/style.h"
15#include "imagecolors.h"
19 BasicThemeDefinition::BasicThemeDefinition(
QObject *parent)
24 auto style = Style::instance();
46 setTrueBlackColors(
true);
51 m_imgColors->setSource(style->adaptiveColorSchemeSource());
57 setSystemPaletteColors();
62 Q_EMIT this->changed();
65 connect(style, &Style::accentColorChanged, [
this, style](
QColor)
67 switch(style->styleType())
69 case Style::StyleType::Light:
89 Q_EMIT this->changed();
92 connect(style, &Style::adaptiveColorSchemeSourceChanged, [
this, style](
QVariant source)
96 m_imgColors->setSource(source);
100 connect(m_imgColors, &ImageColors::paletteChanged, [
this, style]()
105 Q_EMIT this->changed();
108#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
113 setSystemPaletteColors();
114 Q_EMIT this->changed();
122 setSystemPaletteColors();
123 Q_EMIT this->changed();
127 switch(style->styleType())
141 m_imgColors->setSource(style->adaptiveColorSchemeSource());
146 setTrueBlackColors();
151 setTrueBlackColors(
true);
157 setSystemPaletteColors();
164 void BasicThemeDefinition::setSystemPaletteColors()
168 textColor = palette.color(QPalette::ColorRole::WindowText);
169 disabledTextColor = palette.color(QPalette::ColorRole::PlaceholderText);
171 highlightColor = palette.color(QPalette::ColorRole::Highlight);
172 highlightedTextColor = palette.color(QPalette::ColorRole::HighlightedText);
174 backgroundColor = palette.color(QPalette::ColorRole::Window);
179 activeBackgroundColor = highlightColor;
180 alternateBackgroundColor = isDark ? palette.color(QPalette::ColorRole::AlternateBase).lighter(104) : palette.color(QPalette::ColorRole::AlternateBase).darker(104);
182 hoverColor = palette.color(isDark ? QPalette::ColorRole::Midlight :
QPalette::
ColorRole::Mid);
183 focusColor = highlightColor;
185 activeTextColor = highlightColor;
187 buttonTextColor = palette.color(QPalette::ColorRole::ButtonText);
188 buttonBackgroundColor = palette.color(QPalette::ColorRole::Button);
189 buttonAlternateBackgroundColor = isDark ? buttonBackgroundColor.lighter(104) : buttonBackgroundColor.darker(104);
190 buttonHoverColor = palette.color(isDark ? QPalette::ColorRole::Midlight :
QPalette::
ColorRole::Mid);
191 buttonFocusColor = highlightColor;
193 viewTextColor = palette.color(QPalette::ColorRole::Text);
194 viewBackgroundColor = palette.color(QPalette::ColorRole::Base);
195 viewAlternateBackgroundColor = isDark ? viewBackgroundColor.lighter(104) : viewBackgroundColor.darker(104);
196 viewHoverColor = palette.color(isDark ? QPalette::ColorRole::Midlight :
QPalette::
ColorRole::Mid);
197 viewFocusColor = highlightColor;
199 selectionTextColor = palette.color(QPalette::ColorRole::HighlightedText);
200 selectionBackgroundColor = highlightColor;
201 selectionAlternateBackgroundColor = isDark ? highlightColor.lighter() : highlightColor.darker();
202 selectionHoverColor = isDark ? highlightColor.darker() : highlightColor.lighter();
203 selectionFocusColor = highlightColor;
205 bool useDefaultColors =
true;
225 headerTextColor = textColor;
226 headerBackgroundColor = palette.color(QPalette::ColorRole::Window);
227 headerAlternateBackgroundColor =palette.color(QPalette::ColorRole::AlternateBase);
228 headerHoverColor =palette.color(QPalette::ColorRole::Light);
229 headerFocusColor = highlightColor;
233 complementaryTextColor = palette.color(QPalette::ColorRole::BrightText);
234 complementaryBackgroundColor = palette.color(QPalette::ColorRole::Shadow);
235 complementaryAlternateBackgroundColor = palette.color(QPalette::ColorRole::Dark);
236 complementaryHoverColor = palette.color(QPalette::ColorRole::Mid);
237 complementaryFocusColor = highlightColor;
239 linkColor = palette.color(QPalette::ColorRole::Link);
240 linkBackgroundColor = palette.color(QPalette::ColorRole::Light);
241 visitedLinkColor = palette.color(QPalette::ColorRole::LinkVisited);
242 visitedLinkBackgroundColor = palette.color(QPalette::ColorRole::Light);
244 negativeTextColor =
QColor{
"#dac7cb"};
245 negativeBackgroundColor =
QColor{
"#DA4453"};
246 neutralTextColor =
QColor{
"#333"};
247 neutralBackgroundColor =
QColor{
"#F67400"};
248 positiveTextColor =
QColor{
"#333"};
249 positiveBackgroundColor =
QColor{
"#27AE60"};
251 tooltipTextColor =
QColor{
"#fafafa"};
252 tooltipBackgroundColor =
QColor{
"#333"};
253 tooltipAlternateBackgroundColor = tooltipBackgroundColor.
darker();
254 tooltipHoverColor =
QColor{
"#000"};
255 tooltipFocusColor =
QColor{
"#000"};
258 void BasicThemeDefinition::setTrueBlackColors(
bool inverted )
263 textColor = inverted ? color2 :
color1;
264 disabledTextColor = textColor;
266 highlightColor = inverted ? color2 :
color1;
267 highlightedTextColor = inverted ?
color1 : color2;
269 backgroundColor = inverted ?
color1 : color2;
270 activeBackgroundColor = highlightColor;
271 alternateBackgroundColor = backgroundColor;
272 hoverColor = backgroundColor;
273 focusColor = highlightColor;
275 activeTextColor = highlightColor;
277 buttonTextColor = textColor;
278 buttonBackgroundColor = backgroundColor;
279 buttonAlternateBackgroundColor = buttonBackgroundColor;
280 buttonHoverColor = buttonBackgroundColor;
281 buttonFocusColor = buttonBackgroundColor;
283 viewTextColor = textColor;
284 viewBackgroundColor = backgroundColor;
285 viewAlternateBackgroundColor = viewBackgroundColor;
286 viewHoverColor = viewBackgroundColor;
287 viewFocusColor = highlightColor;
289 selectionTextColor = highlightedTextColor;
290 selectionBackgroundColor = highlightColor;
291 selectionAlternateBackgroundColor = selectionBackgroundColor;
292 selectionHoverColor = selectionBackgroundColor;
293 selectionFocusColor = highlightColor;
295 complementaryTextColor = highlightedTextColor;
296 complementaryBackgroundColor = highlightColor;
297 complementaryAlternateBackgroundColor = complementaryBackgroundColor;
298 complementaryHoverColor = complementaryBackgroundColor;
299 complementaryFocusColor = highlightColor;
301 headerTextColor = textColor;
302 headerBackgroundColor = backgroundColor;
303 headerAlternateBackgroundColor = headerBackgroundColor;
304 headerHoverColor = headerBackgroundColor;
305 headerFocusColor = highlightColor;
307 linkColor =
QColor{
"#21b9ff"};
308 linkBackgroundColor =
QColor{
"#21b9ff"};
309 visitedLinkColor =
QColor{
"#ff17d4"};
310 visitedLinkBackgroundColor =
QColor{
"#ff17d4"};
312 negativeTextColor =
QColor{
"#DA4453"};
313 negativeBackgroundColor = backgroundColor;
314 neutralTextColor =
QColor{
"#F67400"};
315 neutralBackgroundColor = backgroundColor;
316 positiveTextColor =
QColor{
"#27AE60"};
317 positiveBackgroundColor = backgroundColor;
319 tooltipTextColor = textColor;
320 tooltipBackgroundColor = backgroundColor;
321 tooltipAlternateBackgroundColor = tooltipBackgroundColor;
322 tooltipHoverColor = tooltipBackgroundColor;
323 tooltipFocusColor = tooltipBackgroundColor;
326 void BasicThemeDefinition::setDarkColors()
330 textColor = DarkColor::textColor;
331 disabledTextColor = DarkColor::disabledTextColor;
336 highlightedTextColor = isDark ?
QColor{
"#eff0f1"} :
QColor{
"#232323"};
338 backgroundColor = cu.
tintWithAlpha(DarkColor::backgroundColor, highlightColor, 0.02);
339 activeBackgroundColor = highlightColor;
340 alternateBackgroundColor = cu.
tintWithAlpha(DarkColor::alternateBackgroundColor, highlightColor, 0.02);
341 hoverColor = cu.
tintWithAlpha(DarkColor::hoverColor, highlightColor, 0.02);
342 focusColor = highlightColor;
344 activeTextColor = highlightColor;
346 buttonTextColor = textColor;
347 buttonBackgroundColor = cu.
tintWithAlpha(DarkColor::buttonBackgroundColor, highlightColor, 0.02);
348 buttonAlternateBackgroundColor = cu.
tintWithAlpha(DarkColor::buttonAlternateBackgroundColor, highlightColor, 0.02);
349 buttonHoverColor = cu.
tintWithAlpha(DarkColor::buttonHoverColor, highlightColor, 0.02);
350 buttonFocusColor = highlightColor;
352 viewTextColor = textColor;
353 viewBackgroundColor = cu.
tintWithAlpha(DarkColor::viewBackgroundColor, highlightColor, 0.02);
354 viewAlternateBackgroundColor = cu.
tintWithAlpha(DarkColor::viewAlternateBackgroundColor, highlightColor, 0.02);
355 viewHoverColor = cu.
tintWithAlpha(DarkColor::viewHoverColor, highlightColor, 0.02);
356 viewFocusColor = highlightColor;
358 selectionTextColor =
QColor{
"#fcfcfc"};
359 selectionBackgroundColor = highlightColor;
360 selectionAlternateBackgroundColor = selectionBackgroundColor.
darker();
361 selectionHoverColor = selectionBackgroundColor.
lighter();
362 selectionFocusColor = highlightColor;
364 complementaryTextColor =
QColor{
"#eff0f1"};
366 complementaryAlternateBackgroundColor = complementaryBackgroundColor.
darker();
367 complementaryHoverColor = complementaryBackgroundColor.
lighter();
368 complementaryFocusColor = highlightColor;
370 headerTextColor = textColor;
371 headerBackgroundColor = cu.
tintWithAlpha(DarkColor::headerBackgroundColor, highlightColor, 0.04);
372 headerAlternateBackgroundColor = cu.
tintWithAlpha(DarkColor::headerAlternateBackgroundColor, highlightColor, 0.02);
373 headerHoverColor = DarkColor::hoverColor;
374 headerFocusColor = highlightColor;
376 linkColor =
QColor{
"#21b9ff"};
377 linkBackgroundColor =
QColor{
"#21b9ff"};
378 visitedLinkColor =
QColor{
"#ff17d4"};
379 visitedLinkBackgroundColor =
QColor{
"#ff17d4"};
381 negativeTextColor =
QColor{
"#dac7cb"};
382 negativeBackgroundColor =
QColor{
"#DA4453"};
383 neutralTextColor =
QColor{
"#333"};
384 neutralBackgroundColor =
QColor{
"#F67400"};
385 positiveTextColor =
QColor{
"#333"};
386 positiveBackgroundColor =
QColor{
"#27AE60"};
388 tooltipTextColor =
QColor{
"#fafafa"};
389 tooltipBackgroundColor =
QColor{
"#333"};
390 tooltipAlternateBackgroundColor = tooltipBackgroundColor.
darker();
391 tooltipHoverColor =
QColor{
"#000"};
392 tooltipFocusColor =
QColor{
"#000"};
395 void BasicThemeDefinition::setLightColors()
399 textColor = LightColor::textColor;
400 disabledTextColor = LightColor::disabledTextColor;
405 highlightedTextColor = isDark ?
QColor{
"#eff0f1"} :
QColor{
"#232323"};
407 backgroundColor = cu.
tintWithAlpha(LightColor::backgroundColor, highlightColor, 0.02);
408 activeBackgroundColor = highlightColor;
409 alternateBackgroundColor = cu.
tintWithAlpha(LightColor::alternateBackgroundColor, highlightColor, 0.02);
410 hoverColor = LightColor::hoverColor;
411 focusColor = highlightColor;
413 activeTextColor = highlightColor;
415 buttonTextColor = textColor;
416 buttonBackgroundColor = cu.
tintWithAlpha(LightColor::buttonBackgroundColor, highlightColor, 0.03);
417 buttonAlternateBackgroundColor = LightColor::buttonAlternateBackgroundColor;
418 buttonHoverColor = cu.
tintWithAlpha(LightColor::buttonHoverColor, highlightColor, 0.02);
419 buttonFocusColor = highlightColor;
421 viewTextColor =
QColor{
"#333333"};
422 viewBackgroundColor = cu.
tintWithAlpha(LightColor::viewBackgroundColor, highlightColor, 0.02);
423 viewAlternateBackgroundColor =cu.
tintWithAlpha(LightColor::viewAlternateBackgroundColor, highlightColor, 0.02);
424 viewHoverColor = cu.
tintWithAlpha(LightColor::viewHoverColor, highlightColor, 0.02);
425 viewFocusColor = highlightColor;
427 selectionTextColor =
QColor{
"#eff0f1"};
428 selectionBackgroundColor = highlightColor;
429 selectionAlternateBackgroundColor = selectionBackgroundColor.
darker(120);
430 selectionHoverColor = selectionBackgroundColor.
lighter(120);
431 selectionFocusColor = highlightColor;
433 complementaryTextColor =
QColor{
"#eff0f1"};
435 complementaryAlternateBackgroundColor = complementaryBackgroundColor.
darker(120);
436 complementaryHoverColor = complementaryBackgroundColor.
lighter(120);
437 complementaryFocusColor = highlightColor;
439 headerTextColor = textColor;
440 headerBackgroundColor = cu.
tintWithAlpha(LightColor::headerBackgroundColor, highlightColor, 0.04);
441 headerAlternateBackgroundColor = cu.
tintWithAlpha(LightColor::headerAlternateBackgroundColor, highlightColor, 0.02);
442 headerHoverColor = LightColor::hoverColor;
443 headerFocusColor = highlightColor;
445 linkColor =
QColor{
"#21b9ff"};
446 linkBackgroundColor =
QColor{
"#21b9ff"};
447 visitedLinkColor =
QColor{
"#ff17d4"};
448 visitedLinkBackgroundColor =
QColor{
"#ff17d4"};
450 negativeTextColor =
QColor{
"#dac7cb"};
451 negativeBackgroundColor =
QColor{
"#DA4453"};
452 neutralTextColor =
QColor{
"#333"};
453 neutralBackgroundColor =
QColor{
"#F67400"};
454 positiveTextColor =
QColor{
"#333"};
455 positiveBackgroundColor =
QColor{
"#27AE60"};
457 tooltipTextColor =
QColor{
"#fafafa"};
458 tooltipBackgroundColor =
QColor{
"#333"};
459 tooltipAlternateBackgroundColor = tooltipBackgroundColor.
darker();
460 tooltipHoverColor =
QColor{
"#000"};
461 tooltipFocusColor =
QColor{
"#000"};
464 void BasicThemeDefinition::setAdaptiveColors()
468 textColor = m_imgColors->foreground();
469 disabledTextColor = textColor.lighter(120);
471 highlightColor = m_imgColors->highlight();
474 const auto bgColor = cu.
tintWithAlpha(isDark ? DarkColor::backgroundColor : LightColor::backgroundColor, m_imgColors->background(), 0.1);
475 const auto btnColor = cu.
tintWithAlpha(isDark ? DarkColor::buttonBackgroundColor : LightColor::buttonBackgroundColor, highlightColor, 0.06);
479 backgroundColor = cu.
tintWithAlpha(bgColor, highlightColor, 0.03);
480 activeBackgroundColor = highlightColor;
481 alternateBackgroundColor = cu.
tintWithAlpha(isDark ? DarkColor::alternateBackgroundColor : LightColor::alternateBackgroundColor, highlightColor, 0.03);
482 hoverColor = cu.
tintWithAlpha(isDark ? DarkColor::hoverColor : LightColor::hoverColor, highlightColor, 0.02);
484 focusColor = highlightColor;
486 activeTextColor = highlightColor;
488 buttonTextColor = textColor;
489 buttonBackgroundColor = btnColor;
490 buttonAlternateBackgroundColor = cu.
tintWithAlpha(isDark ? DarkColor::buttonBackgroundColor : LightColor::buttonBackgroundColor, highlightColor, 0.03);
491 buttonHoverColor = cu.
tintWithAlpha(isDark ? DarkColor::buttonHoverColor : LightColor::buttonHoverColor, highlightColor, 0.03);
492 buttonFocusColor = highlightColor;
494 viewTextColor = textColor;
495 viewBackgroundColor = cu.
tintWithAlpha(isDark ? DarkColor::viewBackgroundColor : LightColor::viewBackgroundColor, highlightColor, 0.07);
496 viewAlternateBackgroundColor = cu.
tintWithAlpha(isDark ? DarkColor::viewAlternateBackgroundColor : LightColor::viewAlternateBackgroundColor, highlightColor, 0.03);
497 viewHoverColor = cu.
tintWithAlpha(isDark ? DarkColor::viewHoverColor : LightColor::viewHoverColor, highlightColor, 0.03);
498 viewFocusColor = highlightColor;
500 selectionTextColor =
QColor{
"#fcfcfc"};
501 selectionBackgroundColor = highlightColor;
502 selectionAlternateBackgroundColor = selectionBackgroundColor.
darker();
503 selectionHoverColor = selectionBackgroundColor.
lighter();
504 selectionFocusColor = highlightColor;
506 complementaryTextColor =
QColor{
"#eff0f1"};
508 complementaryAlternateBackgroundColor = complementaryBackgroundColor.
darker();
509 complementaryHoverColor = complementaryBackgroundColor.
lighter();
510 complementaryFocusColor = highlightColor;
512 headerTextColor = textColor;
513 headerBackgroundColor = cu.
tintWithAlpha(bgColor, highlightColor, 0.05);
514 headerAlternateBackgroundColor = headerBackgroundColor.
darker();
515 headerHoverColor = headerBackgroundColor.
lighter();
516 headerFocusColor = highlightColor;
518 linkColor =
QColor{
"#2980B9"};
519 linkBackgroundColor =
QColor{
"#2980B9"};
520 visitedLinkColor =
QColor{
"#7F8C8D"};
521 visitedLinkBackgroundColor =
QColor{
"#2196F3"};
523 negativeTextColor =
QColor{
"#dac7cb"};
524 negativeBackgroundColor =
QColor{
"#DA4453"};
525 neutralTextColor =
QColor{
"#333"};
526 neutralBackgroundColor =
QColor{
"#F67400"};
527 positiveTextColor =
QColor{
"#333"};
528 positiveBackgroundColor =
QColor{
"#27AE60"};
530 tooltipTextColor =
QColor{
"#fafafa"};
531 tooltipBackgroundColor =
QColor{
"#333"};
532 tooltipAlternateBackgroundColor = tooltipBackgroundColor.
darker();
533 tooltipHoverColor =
QColor{
"#000"};
534 tooltipFocusColor =
QColor{
"#000"};
537 void BasicThemeDefinition::syncToQml(PlatformTheme *
object)
539 auto item = qobject_cast<QQuickItem *>(object->parent());
540 if (item && qmlAttachedPropertiesObject<PlatformTheme>(item,
false) ==
object) {
545 BasicThemeInstance::BasicThemeInstance(
QObject *parent)
550 BasicThemeDefinition &BasicThemeInstance::themeDefinition(
QQmlEngine *engine)
552 if (m_themeDefinition) {
553 return *m_themeDefinition;
556 m_themeDefinition = std::make_unique<BasicThemeDefinition>();
558 connect(m_themeDefinition.get(), &BasicThemeDefinition::changed,
this, &BasicThemeInstance::onDefinitionChanged);
560 return *m_themeDefinition;
563 void BasicThemeInstance::onDefinitionChanged()
565 for (
auto watcher :
std::as_const(watchers))
571 Q_GLOBAL_STATIC(BasicThemeInstance, basicThemeInstance)
573 BasicTheme::BasicTheme(
QObject *parent)
574 : PlatformTheme(parent)
576 basicThemeInstance()->watchers.append(
this);
581 BasicTheme::~BasicTheme()
583 basicThemeInstance()->watchers.removeOne(
this);
586 void BasicTheme::sync()
588 auto &definition = basicThemeInstance()->themeDefinition(qmlEngine(parent()));
590 switch (colorSet()) {
591 case BasicTheme::Button:
592 setTextColor(
tint(definition.buttonTextColor));
593 setBackgroundColor(
tint(definition.buttonBackgroundColor));
594 setAlternateBackgroundColor(
tint(definition.buttonAlternateBackgroundColor));
595 setHoverColor(
tint(definition.buttonHoverColor));
596 setFocusColor(
tint(definition.buttonFocusColor));
598 case BasicTheme::View:
599 setTextColor(
tint(definition.viewTextColor));
600 setBackgroundColor(
tint(definition.viewBackgroundColor));
601 setAlternateBackgroundColor(
tint(definition.viewAlternateBackgroundColor));
602 setHoverColor(
tint(definition.viewHoverColor));
603 setFocusColor(
tint(definition.viewFocusColor));
605 case BasicTheme::Selection:
606 setTextColor(
tint(definition.selectionTextColor));
607 setBackgroundColor(
tint(definition.selectionBackgroundColor));
608 setAlternateBackgroundColor(
tint(definition.selectionAlternateBackgroundColor));
609 setHoverColor(
tint(definition.selectionHoverColor));
610 setFocusColor(
tint(definition.selectionFocusColor));
612 case BasicTheme::Tooltip:
613 setTextColor(
tint(definition.tooltipTextColor));
614 setBackgroundColor(
tint(definition.tooltipBackgroundColor));
615 setAlternateBackgroundColor(
tint(definition.tooltipAlternateBackgroundColor));
616 setHoverColor(
tint(definition.tooltipHoverColor));
617 setFocusColor(
tint(definition.tooltipFocusColor));
619 case BasicTheme::Complementary:
620 setTextColor(
tint(definition.complementaryTextColor));
621 setBackgroundColor(
tint(definition.complementaryBackgroundColor));
622 setAlternateBackgroundColor(
tint(definition.complementaryAlternateBackgroundColor));
623 setHoverColor(
tint(definition.complementaryHoverColor));
624 setFocusColor(
tint(definition.complementaryFocusColor));
626 case BasicTheme::Header:
627 setTextColor(
tint(definition.headerTextColor));
628 setBackgroundColor(
tint(definition.headerBackgroundColor));
629 setAlternateBackgroundColor(
tint(definition.headerAlternateBackgroundColor));
630 setHoverColor(
tint(definition.headerHoverColor));
631 setFocusColor(
tint(definition.headerFocusColor));
633 case BasicTheme::Window:
635 setTextColor(
tint(definition.textColor));
636 setBackgroundColor(
tint(definition.backgroundColor));
637 setAlternateBackgroundColor(
tint(definition.alternateBackgroundColor));
638 setHoverColor(
tint(definition.hoverColor));
639 setFocusColor(
tint(definition.focusColor));
643 setDisabledTextColor(
tint(definition.disabledTextColor));
644 setHighlightColor(
tint(definition.highlightColor));
645 setHighlightedTextColor(
tint(definition.highlightedTextColor));
646 setActiveTextColor(
tint(definition.activeTextColor));
647 setActiveBackgroundColor(
tint(definition.activeBackgroundColor));
648 setLinkColor(
tint(definition.linkColor));
649 setLinkBackgroundColor(
tint(definition.linkBackgroundColor));
650 setVisitedLinkColor(
tint(definition.visitedLinkColor));
651 setVisitedLinkBackgroundColor(
tint(definition.visitedLinkBackgroundColor));
652 setNegativeTextColor(
tint(definition.negativeTextColor));
653 setNegativeBackgroundColor(
tint(definition.negativeBackgroundColor));
654 setNeutralTextColor(
tint(definition.neutralTextColor));
655 setNeutralBackgroundColor(
tint(definition.neutralBackgroundColor));
656 setPositiveTextColor(
tint(definition.positiveTextColor));
657 setPositiveBackgroundColor(
tint(definition.positiveBackgroundColor));
660 bool BasicTheme::event(
QEvent *event)
662 if (
event->type() == PlatformThemeEvents::DataChangedEvent::type) {
666 if (
event->type() == PlatformThemeEvents::ColorSetChangedEvent::type) {
670 if (
event->type() == PlatformThemeEvents::ColorGroupChangedEvent::type) {
674 if (
event->type() == PlatformThemeEvents::ColorChangedEvent::type) {
675 basicThemeInstance()->themeDefinition(qmlEngine(parent())).syncToQml(
this);
678 if (
event->type() == PlatformThemeEvents::FontChangedEvent::type) {
679 basicThemeInstance()->themeDefinition(qmlEngine(parent())).syncToQml(
this);
682 return PlatformTheme::event(event);
687 switch (colorGroup()) {
688 case PlatformTheme::Inactive:
690 case PlatformTheme::Disabled:
Q_INVOKABLE QColor tintWithAlpha(const QColor &targetColor, const QColor &tintColor, double alpha)
Q_INVOKABLE ColorUtils::Brightness brightnessForColor(const QColor &color)
StyleType
The different options for the color scheme style.
@ TrueBlack
A fully black color palette with a full white accent color.
@ Inverted
A fully white color palette with a true black accent color.
@ Light
A light variant designed for Maui.
@ Dark
A dark variant designed for Maui.
@ Auto
Picks the colors from the system palette, usually from Plasma color-scheme files.
@ Adaptive
Picks the color scheme based on an source input, such as an image.
QColor accentColor
Sets the color to be used for highlighted, active, checked and such states of the UI elements.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
KGUIADDONS_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
QColor darker(int factor) const const
QColor fromHsvF(float h, float s, float v, float a)
QColor lighter(int factor) const const
float saturationF() const const
float valueF() const const
void paletteChanged(const QPalette &palette)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)