Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosplatformtheme.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "private/qohosplatformtheme_p.h"
11#include <QtCore/private/qcore_ohos_p.h>
12#include <QtCore/private/qohoscommon_p.h>
13#include <QtCore/private/qohoslogger_p.h>
14#include <QtGui/private/qguiapplication_p.h>
15#include <QtGui/private/qhighdpiscaling_p.h>
16#include <QtGui/private/qabstractfileiconengine_p.h>
17#include <initializer_list>
18#include <memory>
19#include <qohosjsmain.h>
20#include <qohosjsutils.h>
21#include <qohosqpaenums.h>
22#include <qohosutils.h>
23#include <qpa/qplatformfontdatabase.h>
24#include <qpa/qplatformintegration.h>
25#include <string>
26#include <tuple>
27
29
30namespace {
31
33{
34 auto disabledColor = color;
35 disabledColor.setAlphaF(qBound(0.0, color.alphaF() * 0.4, 1.0));
36
37 return disabledColor;
38}
39
40QColor makeOverlayCompositedOnSurface(const QColor &overlay, const QColor &surface)
41{
42 const auto alpha = overlay.alphaF();
43
44 return QColor::fromRgbF(
45 overlay.redF() * alpha + surface.redF() * (1.0 - alpha),
46 overlay.greenF() * alpha + surface.greenF() * (1.0 - alpha),
47 overlay.blueF() * alpha + surface.blueF() * (1.0 - alpha));
48}
49
75
76PalettesColors makePalettesColorsLight(const QColor &accentColor)
77{
78 const auto activeWindow = QColor("#FFFFFFFF");
79 const auto activeButtonText = QColor("#0A59F7");
80 const auto textPrimary = QColor("#FF182431");
81
82 return {
83 .activeWindow = activeWindow,
84 .inactiveWindow = makeInactiveOrDisabledFromColor(activeWindow),
85 .activeButtonText = activeButtonText,
86 .inactiveButtonText = makeInactiveOrDisabledFromColor(activeButtonText),
87 .activeHighlight = accentColor,
88 .inactiveHighlight = makeInactiveOrDisabledFromColor(accentColor),
89 .clickEffect = QColor("#1A000000"),
90 .hover = QColor("#0D000000"),
91 .foregroundContrary = QColor("#FFFFFF"),
92 .highlighted = accentColor,
93 .inactiveHighlighted = makeInactiveOrDisabledFromColor(accentColor),
94 .textPrimary = textPrimary,
95 .inactiveTextPrimary = textPrimary,
96 .disabledTextPrimary = makeInactiveOrDisabledFromColor(textPrimary),
97 .inactiveText = makeInactiveOrDisabledFromColor(textPrimary),
98 .componentNormal = QColor("#19182431"),
99 .componentActivated = QColor("#007DFF"),
100 .indicatorArrow = QColor("#E5182431"),
101 .scrollBarSlider = QColor("#182431"),
102 .switchBgOff = QColor("#33FFFFFF"),
103 .switchOutlineOff = QColor("#66182431"),
104 .window = QColor("#FFF1F3F5"),
105 };
106};
107
108PalettesColors makePalettesColorsDark(const QColor &accentColor)
109{
110 const auto activeWindow = QColor("#18181A");
111 const auto activeButtonText = QColor("#3F97E9");
112 const auto textPrimary = QColor("#DBFFFFFF");
113
114 return {
115 .activeWindow = activeWindow,
116 .inactiveWindow = makeInactiveOrDisabledFromColor(activeWindow),
117 .activeButtonText = activeButtonText,
118 .inactiveButtonText = makeInactiveOrDisabledFromColor(activeButtonText),
119 .activeHighlight = accentColor,
120 .inactiveHighlight = makeInactiveOrDisabledFromColor(accentColor),
121 .clickEffect = QColor("#26FFFFFF"),
122 .hover = QColor("#19FFFFFF"),
123 .foregroundContrary = QColor("#E5E5E5"),
124 .highlighted = accentColor,
125 .inactiveHighlighted = makeInactiveOrDisabledFromColor(accentColor),
126 .textPrimary = textPrimary,
127 .inactiveTextPrimary = textPrimary,
128 .disabledTextPrimary = makeInactiveOrDisabledFromColor(textPrimary),
129 .inactiveText = makeInactiveOrDisabledFromColor(textPrimary),
130 .componentNormal = QColor("#19FFFFFF"),
131 .componentActivated = QColor("#3F97E9"),
132 .indicatorArrow = QColor("#DBFFFFFF"),
133 .scrollBarSlider = QColor("#FFFFFF"),
134 .switchBgOff = QColor("#33000000"),
135 .switchOutlineOff = QColor("#66FFFFFF"),
136 .window = QColor("#FF000000"),
137 };
138}
139
147
149{
150 const auto activeButton = QColor("#0C182431");
151
152 return {
153 .activeButton = activeButton,
154 .inactiveButton = makeInactiveOrDisabledFromColor(activeButton),
155 .focusedOutline = accentColor,
156 .enabledDefaultButtonText = QColor("#FFFFFFFF"),
157 };
158};
159
161{
162 const auto activeButton = QColor("#19FFFFFF");
163
164 return {
165 .activeButton = activeButton,
166 .inactiveButton = makeInactiveOrDisabledFromColor(activeButton),
167 .focusedOutline = accentColor,
168 .enabledDefaultButtonText = QColor("#E5E5E5"),
169 };
170}
171
176
178{
179 return {
180 .windowButtonBackground = QColor("#FFD0CFD5"),
181 };
182};
183
185{
186 return {
187 .windowButtonBackground = QColor("#FFD0CFD5"),
188 };
189};
190
197
199{
200 return {
201 .activeWindowFrame = QColor("#FFE4E4E4"),
202 .textHint = QColor("#99182431"),
203 .textTertiary = QColor("#66182431"),
204 };
205};
206
208{
209 return {
210 .activeWindowFrame = QColor("#FF000000"),
211 .textHint = QColor("#99FFFFFF"),
212 .textTertiary = QColor("#66FFFFFF"),
213 };
214}
215
221
223{
224 return {
225 .listSeparator = QColor("#1A000000"),
226 .inactiveText = makeInactiveOrDisabledFromColor(palettes.textPrimary),
227 };
228};
229
231{
232 return {
233 .listSeparator = QColor("#33FFFFFF"),
234 .inactiveText = makeInactiveOrDisabledFromColor(palettes.textPrimary),
235 };
236}
237
244
246{
247 const auto inactiveWindowText = QColor("#99182431");
248
249 return {
250 .activeWindowText = accentColor,
251 .inactiveWindowText = inactiveWindowText,
252 .disabledWindowText = makeInactiveOrDisabledFromColor(inactiveWindowText),
253 };
254};
255
257{
258 const auto inactiveWindowText = QColor("#99FFFFFF");
259
260 return {
261 .activeWindowText = accentColor,
262 .inactiveWindowText = inactiveWindowText,
263 .disabledWindowText = makeInactiveOrDisabledFromColor(inactiveWindowText),
264 };
265}
266
272
274{
275 const auto textEditBackground = QColor("#0C182431");
276 return {
277 .textEditBackground = textEditBackground,
278 .inactiveTextEditBackground = makeInactiveOrDisabledFromColor(textEditBackground),
279 };
280};
281
283{
284 const auto textEditBackground = QColor("#19FFFFFF");
285 return {
286 .textEditBackground = textEditBackground,
287 .inactiveTextEditBackground = makeInactiveOrDisabledFromColor(textEditBackground),
288 };
289}
290
295
297{
298 return {
299 .buttonBackground = QColor("#0C000000"),
300 };
301};
302
304{
305 return {
306 .buttonBackground = QColor("#33FFFFFF"),
307 };
308}
309
316
318{
319 return {
320 .background = QColor("#00000000"),
321 .groupBoxFrame = QColor("#66000000"),
322 .shadowXS = QColor("#19000000"),
323 };
324};
325
327{
328 return {
329 .background = QColor("#00000000"),
330 .groupBoxFrame = QColor("#66FFFFFF"),
331 .shadowXS = QColor("#19FFFFFF"),
332 };
333}
334
339
341{
342 return {
343 .activeButton = QColor("#FFFFFFFF"),
344 };
345};
346
348{
349 return {
350 .activeButton = QColor("#FF18181A"),
351 };
352}
353
359
361{
362 return {
363 .toolTipBorder = QColor("#1A000000"),
364 .toolTipBase = QColor("#FFFFFFFF"),
365 };
366};
367
369{
370 return {
371 .toolTipBorder = QColor("#1AFFFFFF"),
372 .toolTipBase = QColor("#404040"),
373 };
374}
375
390
392{
393 const auto palettes = makePalettesColorsLight(accentColor);
394
395 return {
396 .palettes = palettes,
397 .button = makeButtonPaletteColorsLight(accentColor),
398 .toolButton = makeToolButtonPaletteColorsLight(),
399 .system = makeSystemButtonPaletteColorsLight(),
400 .menu = makeMenuPaletteColorsLight(palettes),
401 .tabBar = makeTabBarPaletteColorsLight(accentColor),
402 .textLineEdit = makeTextLineEditPaletteColorsLight(),
403 .comboBox = makeComboBoxPaletteColorsLight(),
404 .groupBox = makeGroupboxPaletteColorsLight(),
405 .header = makeHeaderPaletteColorsLight(),
406 .toolTip = makeTooltipPaletteColorsLight(),
407 };
408}
409
411{
412 const auto palettes = makePalettesColorsDark(accentColor);
413
414 return {
415 .palettes = palettes,
416 .button = makeButtonPaletteColorsDark(accentColor),
417 .toolButton = makeToolButtonPaletteColorsDark(),
418 .system = makeSystemButtonPaletteColorsDark(),
419 .menu = makeMenuPaletteColorsDark(palettes),
420 .tabBar = makeTabBarPaletteColorsDark(accentColor),
421 .textLineEdit = makeTextLineEditPaletteColorsDark(),
422 .comboBox = makeComboBoxPaletteColorsDark(),
423 .groupBox = makeGroupboxPaletteColorsDark(),
424 .header = makeHeaderPaletteColorsDark(),
425 .toolTip = makeTooltipPaletteColorsDark(),
426 };
427}
428
429AllPalletesColors makeAllPalettesColors(Qt::ColorScheme scheme, const QColor &accentColor)
430{
431 switch (scheme) {
432 case Qt::ColorScheme::Light: return makeAllPalettesColorsLight(accentColor);
433 case Qt::ColorScheme::Dark: return makeAllPalettesColorsDark(accentColor);
434 default:
435 break;
436 }
437
438 qOhosReportFatalErrorAndAbort(
439 "%s: got unsupported ColorScheme: %d", Q_FUNC_INFO, static_cast<int>(scheme));
440}
441
442constexpr int mouseDoubleClickDistance = 60;
443constexpr int mouseDoubleClickInterval = 300;
444
446 const QPalette &basePalette, std::initializer_list<std::tuple<QPalette::ColorGroup, QPalette::ColorRole, const QColor &>> brushEntries)
447{
448 auto palette = basePalette;
449
450 for (const auto &brushEntry : brushEntries) {
451 palette.setBrush(
452 std::get<QPalette::ColorGroup>(brushEntry),
453 std::get<QPalette::ColorRole>(brushEntry),
454 std::get<const QColor &>(brushEntry));
455 }
456
457 return palette;
458}
459
461{
462 const auto &colors = palettesColors.palettes;
463 const auto button = makeOverlayCompositedOnSurface(
464 palettesColors.button.activeButton, colors.activeWindow);
465
466 QPalette palette(button, colors.activeWindow);
467
468 const auto textVersions = {
469 std::make_pair(QPalette::Active, colors.textPrimary),
470 std::make_pair(QPalette::Inactive, colors.inactiveTextPrimary),
471 std::make_pair(QPalette::Disabled, colors.disabledTextPrimary)};
472
473 for (const auto &groupAndText : textVersions) {
474 palette.setColor(groupAndText.first, QPalette::WindowText, groupAndText.second);
475 palette.setColor(groupAndText.first, QPalette::Text, groupAndText.second);
476 palette.setColor(groupAndText.first, QPalette::ButtonText, groupAndText.second);
477 }
478 palette.setColor(QPalette::BrightText, colors.foregroundContrary);
479
480 return palette;
481}
482
484{
485 return makePalette(
486 makeBasePalette(palettesColors),
487 {
488 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.componentActivated},
489
490 {QPalette::Active, QPalette::Button, palettesColors.button.activeButton},
491 {QPalette::Disabled, QPalette::Button, palettesColors.button.inactiveButton},
492 {QPalette::Inactive, QPalette::Button, palettesColors.button.inactiveButton},
493
494 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
495 {QPalette::Disabled, QPalette::ButtonText, palettesColors.palettes.inactiveButtonText},
496 {QPalette::Inactive, QPalette::ButtonText, palettesColors.palettes.inactiveButtonText},
497
498 {QPalette::All, QPalette::BrightText, palettesColors.button.enabledDefaultButtonText},
499
500 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
501 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
502
503 {QPalette::Active, QPalette::Highlight, palettesColors.button.focusedOutline},
504 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.indicatorArrow}
505 });
506}
507
509{
510 return makePalette(
511 makeButtonPalette(palettesColors),
512 {
513 {QPalette::Active, QPalette::AlternateBase, palettesColors.toolButton.windowButtonBackground},
514 });
515}
516
518{
519 return makePalette(
520 makeBasePalette(palettesColors),
521 {
522 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
523 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.activeWindow},
524 {QPalette::Inactive, QPalette::Window, palettesColors.palettes.activeWindow},
525
526 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.textPrimary},
527 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.disabledTextPrimary},
528 {QPalette::Inactive, QPalette::WindowText, palettesColors.palettes.inactiveTextPrimary},
529
530 {QPalette::Active, QPalette::Text, palettesColors.palettes.textPrimary},
531 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.disabledTextPrimary},
532 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.inactiveTextPrimary},
533
534 {QPalette::Active, QPalette::Base, palettesColors.palettes.window},
535 {QPalette::Disabled, QPalette::Base, palettesColors.palettes.window},
536 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.window},
537
538 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.textPrimary},
539
540 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.highlighted},
541
542 {QPalette::All, QPalette::PlaceholderText, palettesColors.system.textHint},
543 {QPalette::Disabled, QPalette::PlaceholderText, palettesColors.system.textTertiary},
544
545 {QPalette::Active, QPalette::Midlight, palettesColors.palettes.scrollBarSlider},
546
547 {QPalette::Active, QPalette::Mid, palettesColors.palettes.componentNormal},
548 {QPalette::Active, QPalette::Shadow, palettesColors.groupBox.shadowXS}
549 });
550}
551
553{
554 return makePalette(
555 makeBasePalette(palettesColors),
556 {
557 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
558 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
559 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
560 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.highlighted},
561 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.highlighted},
562 {QPalette::Inactive, QPalette::WindowText, palettesColors.palettes.inactiveText},
563 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.inactiveHighlighted},
564 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
565 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
566 });
567}
568
570{
571 return makePalette(
572 makeBasePalette(palettesColors),
573 {
574 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.componentActivated},
575 {QPalette::All, QPalette::Base, palettesColors.palettes.window},
576 {QPalette::All, QPalette::Window, palettesColors.palettes.window},
577 {QPalette::Active, QPalette::Text, palettesColors.palettes.highlighted},
578 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveText},
579 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.inactiveHighlighted},
580 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
581 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
582 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.indicatorArrow},
583 {QPalette::All, QPalette::Button, palettesColors.comboBox.buttonBackground}
584 });
585}
586
588{
589 return makePalette(
590 makeBasePalette(palettesColors),
591 {
592 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
593 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
594 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
595 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
596
597 {QPalette::Active, QPalette::Text, palettesColors.palettes.textPrimary},
598 {QPalette::Disabled, QPalette::Text, palettesColors.menu.inactiveText},
599 {QPalette::Inactive, QPalette::Text, palettesColors.menu.inactiveText},
600
601 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
602 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
603
604 {QPalette::Active, QPalette::Mid, palettesColors.menu.listSeparator}
605 });
606}
607
609{
610 return makePalette(
611 makeBasePalette(palettesColors),
612 {
613 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.textPrimary},
614 {QPalette::Disabled, QPalette::ButtonText, palettesColors.menu.inactiveText},
615 {QPalette::Inactive, QPalette::ButtonText, palettesColors.menu.inactiveText},
616 });
617}
618
620{
621 return makePalette(
622 makeBasePalette(palettesColors),
623 {
624 {QPalette::Active, QPalette::WindowText, palettesColors.tabBar.activeWindowText},
625 {QPalette::Inactive, QPalette::WindowText, palettesColors.tabBar.inactiveWindowText},
626 {QPalette::Disabled, QPalette::WindowText, palettesColors.tabBar.disabledWindowText},
627
628 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
629 {QPalette::Inactive, QPalette::Window, palettesColors.palettes.inactiveWindow},
630 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.inactiveWindow},
631
632 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.activeHighlight},
633 {QPalette::Inactive, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
634 {QPalette::Disabled, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
635 });
636}
637
639{
640 return makePalette(
641 makeSystemPalette(palettesColors),
642 {
643 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.componentActivated},
644 {QPalette::All, QPalette::Base, palettesColors.textLineEdit.textEditBackground},
645 {QPalette::Disabled, QPalette::Base, palettesColors.textLineEdit.inactiveTextEditBackground},
646 {QPalette::All, QPalette::Text, palettesColors.palettes.textPrimary},
647 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.disabledTextPrimary},
648 });
649}
650
652{
653 return makePalette(
654 makeTextLineEditPalette(palettesColors),
655 {
656 {QPalette::All, QPalette::Base, palettesColors.palettes.activeWindow},
657 });
658}
659
661{
662 return makePalette(
663 makeBasePalette(palettesColors),
664 {
665 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
666 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
667 {QPalette::Active, QPalette::Base, palettesColors.system.activeWindowFrame},
668 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
669 {QPalette::Active, QPalette::AlternateBase, palettesColors.groupBox.groupBoxFrame},
670 {QPalette::Active, QPalette::Window, palettesColors.groupBox.background},
671 {QPalette::Inactive, QPalette::Window, palettesColors.groupBox.background},
672 {QPalette::Active, QPalette::Window, palettesColors.palettes.window},
673 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.window},
674 {QPalette::Active, QPalette::Text, palettesColors.palettes.highlighted},
675 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.highlighted},
676 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveHighlighted},
677 {QPalette::Current, QPalette::Text, palettesColors.palettes.highlighted},
678 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.inactiveHighlighted},
679 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.textPrimary},
680 {QPalette::Disabled, QPalette::ButtonText, palettesColors.palettes.inactiveHighlighted},
681 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
682 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
683 {QPalette::Active, QPalette::Shadow, palettesColors.groupBox.shadowXS},
684 {QPalette::Active, QPalette::Midlight, palettesColors.palettes.scrollBarSlider},
685 {QPalette::Active, QPalette::Mid, palettesColors.palettes.componentNormal}
686 });
687}
688
690{
691 return makePalette(
692 makeBasePalette(palettesColors),
693 {
694 {QPalette::Active, QPalette::Button, palettesColors.header.activeButton},
695 {QPalette::Inactive, QPalette::Button, palettesColors.header.activeButton},
696 {QPalette::Disabled, QPalette::Button, palettesColors.palettes.inactiveWindow},
697
698 {QPalette::Current, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
699 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
700 {QPalette::Inactive, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
701 {QPalette::Disabled, QPalette::ButtonText, palettesColors.palettes.inactiveButtonText},
702 });
703}
704
706{
707 return makePalette(
708 makeSystemPalette(palettesColors),
709 {
710 {QPalette::Active, QPalette::Base, palettesColors.palettes.window},
711 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.window},
712 {QPalette::Disabled, QPalette::Base, palettesColors.palettes.window},
713
714 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
715 {QPalette::Inactive, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
716 {QPalette::Disabled, QPalette::AlternateBase, palettesColors.palettes.inactiveWindow},
717 {QPalette::Current, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
718
719 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.activeHighlight},
720 {QPalette::Inactive, QPalette::Highlight, palettesColors.palettes.activeHighlight},
721 {QPalette::Disabled, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
722
723 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
724 {QPalette::Inactive, QPalette::Window, palettesColors.palettes.activeWindow},
725 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.inactiveWindow},
726
727 {QPalette::Active, QPalette::Text, palettesColors.palettes.activeHighlight},
728 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.activeHighlight},
729 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveHighlight},
730
731 {QPalette::Active, QPalette::HighlightedText, palettesColors.palettes.activeWindow},
732 {QPalette::Inactive, QPalette::HighlightedText, palettesColors.palettes.activeWindow},
733 {QPalette::Disabled, QPalette::HighlightedText, palettesColors.palettes.inactiveWindow},
734
735 {QPalette::Active, QPalette::Dark, palettesColors.palettes.activeWindow},
736 {QPalette::Inactive, QPalette::Dark, palettesColors.palettes.activeWindow},
737 {QPalette::Disabled, QPalette::Dark, palettesColors.palettes.inactiveWindow},
738 {QPalette::Current, QPalette::Dark, palettesColors.palettes.activeWindow},
739 {QPalette::All, QPalette::Dark, palettesColors.palettes.activeWindow},
740
741 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
742 {QPalette::Inactive, QPalette::Light, palettesColors.palettes.activeWindow},
743 {QPalette::Disabled, QPalette::Light, palettesColors.palettes.inactiveWindow},
744
745 {QPalette::Active, QPalette::Mid, palettesColors.palettes.activeWindow},
746 {QPalette::Inactive, QPalette::Mid, palettesColors.palettes.activeWindow},
747 {QPalette::Disabled, QPalette::Mid, palettesColors.palettes.inactiveWindow},
748 {QPalette::Current, QPalette::Mid, palettesColors.palettes.activeWindow},
749 {QPalette::All, QPalette::Mid, palettesColors.palettes.activeWindow},
750 });
751}
752
754{
755 return makePalette(
756 makeBasePalette(palettesColors),
757 {
758 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.textPrimary},
759 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.disabledTextPrimary},
760 {QPalette::Inactive, QPalette::WindowText, palettesColors.palettes.inactiveTextPrimary},
761
762 {QPalette::Active, QPalette::Text, palettesColors.palettes.textPrimary},
763 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.disabledTextPrimary},
764 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.inactiveTextPrimary},
765 });
766}
767
769{
770 return makePalette(
771 makeBasePalette(palettesColors),
772 {
773 {QPalette::All, QPalette::Base, palettesColors.toolTip.toolTipBorder},
774 {QPalette::All, QPalette::ToolTipBase, palettesColors.toolTip.toolTipBase},
775 {QPalette::All, QPalette::ToolTipText, palettesColors.palettes.highlighted},
776 });
777}
778
780{
781 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
782 font.setPointSize(16);
783
784 return font;
785}
786
788{
789 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
790 font.setPointSize(12);
791 font.setBold(false);
792
793 return font;
794}
795
797{
798 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
799 font.setPointSize(20);
800 font.setBold(true);
801
802 return font;
803}
804
806{
807 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
808 font.setPointSize(16);
809
810 return font;
811}
812
814{
815 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
816 font.setPointSize(16);
817
818 return font;
819}
820
822{
823 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
824 font.setPointSize(16);
825
826 return font;
827}
828
830{
831 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
832 font.setPointSize(14);
833
834 return font;
835}
836
838{
839 return {
840 {QPlatformTheme::DockWidgetTitleFont, makeTitleFont()},
841 {QPlatformTheme::GroupBoxTitleFont, makeGroupBoxTitleFont()},
842 {QPlatformTheme::ListViewFont, makeListViewFont()},
843 {QPlatformTheme::MenuBarFont, makeMenuFont()},
844 {QPlatformTheme::MenuFont, makeMenuFont()},
845 {QPlatformTheme::MenuItemFont, makeMenuFont()},
846 {QPlatformTheme::PushButtonFont, makePushButtonFont()},
847 {QPlatformTheme::SystemFont, makeSystemFont()},
848 {QPlatformTheme::TipLabelFont, makeTipLabelFont()},
849 };
850}
851
852QHash<QPlatformTheme::Palette, QPalette> makePalettesMap(Qt::ColorScheme scheme, const QColor &accentColor)
853{
854 const AllPalletesColors palettesColors = makeAllPalettesColors(scheme, accentColor);
855 return {
856 {QPlatformTheme::ButtonPalette, makeButtonPalette(palettesColors)},
857 {QPlatformTheme::CheckBoxPalette, makeCheckBoxOrRadioButtonPalette(palettesColors)},
858 {QPlatformTheme::ComboBoxPalette, makeComboBoxPalette(palettesColors)},
859 {QPlatformTheme::GroupBoxPalette, makeGroupBoxPalette(palettesColors)},
860 {QPlatformTheme::HeaderPalette, makeHeaderPalette(palettesColors)},
861 {QPlatformTheme::ItemViewPalette, makeItemViewPalette(palettesColors)},
862 {QPlatformTheme::LabelPalette, makeLabelPalette(palettesColors)},
863 {QPlatformTheme::MenuPalette, makeMenuPalette(palettesColors)},
864 {QPlatformTheme::MenuBarPalette, makeMenuBarPalette(palettesColors)},
865 {QPlatformTheme::RadioButtonPalette, makeCheckBoxOrRadioButtonPalette(palettesColors)},
866 {QPlatformTheme::SystemPalette, makeSystemPalette(palettesColors)},
867 {QPlatformTheme::TabBarPalette, makeTabBarPalette(palettesColors)},
868 {QPlatformTheme::TextEditPalette, makeTextEditPalette(palettesColors)},
869 {QPlatformTheme::TextLineEditPalette, makeTextLineEditPalette(palettesColors)},
870 {QPlatformTheme::ToolButtonPalette, makeToolButtonPalette(palettesColors)},
871 {QPlatformTheme::ToolTipPalette, makeToolTipPalette(palettesColors)},
872 };
873}
874
876 Qt::ColorScheme scheme)
877{
878 switch (scheme) {
879 case Qt::ColorScheme::Unknown:
880 return std::nullopt;
881 case Qt::ColorScheme::Light:
882 return false;
883 case Qt::ColorScheme::Dark:
884 return true;
885 };
886 return std::nullopt;
887}
888
890 std::optional<bool> darkModeFlag)
891{
892 if (darkModeFlag.has_value()) {
893 if (!darkModeFlag.value_or(false))
894 return Qt::ColorScheme::Light;
895 else
896 return Qt::ColorScheme::Dark;
897 } else {
898 return Qt::ColorScheme::Unknown;
899 }
900}
901
903
904OhosConfigurationColorMode mapOhosConfigurationColorModeFromJs(QOhosJsState &jsState, QNapi::Number colorModeJsEnum)
905{
906 constexpr auto fallbackColorMode = OhosConfigurationColorMode::COLOR_MODE_NOT_SET;
907 auto optColorMode = jsState.tryMapOhosEnumFromJs<OhosConfigurationColorMode>(colorModeJsEnum);
908 return optColorMode.value_or(fallbackColorMode);
909};
910
912{
914 qCWarning(QtForOhos, "%s: cannot set a color mode in 'no UI child mode'", Q_FUNC_INFO);
915 return;
916 }
917
918 QOhosJsThreadGateway::runAndWait(
919 [&](QOhosJsState &jsState) {
920 auto optQAbility = jsState.defaultQAbility();
921 if (!optQAbility) {
922 qCWarning(QtForOhos, "%s: cannot set a color mode without a UIAbility", Q_FUNC_INFO);
923 return;
924 }
925
926 const auto jsColorMode = jsState.mapOhosEnumToJs(colorMode);
927 optQAbility->eval("context.getApplicationContext().setColorMode(*)", {jsColorMode});
928 },
929 Q_FUNC_INFO);
930}
931
933{
934 switch (colorMode) {
936 return std::nullopt;
938 return false;
940 return true;
941 }
942
943 return std::nullopt;
944}
945
946QColor readAccentColor(QOhosJsState &jsState)
947{
948 auto optQAbility = jsState.defaultQAbility();
949 if (!optQAbility)
950 return {};
951
952 const auto argb = static_cast<uint32_t>(
953 optQAbility->eval<QNapi::Number>(
954 "context.resourceManager.getColorByNameSync(*)",
955 {"ohos_id_color_emphasize"}));
956 return QColor::fromRgba(argb);
957}
958
960{
963
964 bool operator==(const OhosThemeConfig &other) const
965 {
966 return colorMode == other.colorMode && accentColor == other.accentColor;
967 }
968
969 bool operator!=(const OhosThemeConfig &other) const
970 {
971 return !(*this == other);
972 }
973};
974
976 QOhosConsumer<OhosThemeConfig> valueChangedHandler)
977{
978 return QtOhos::makeOhosConfigValueDataSource<OhosThemeConfig>(
979 [](QOhosJsState &jsState) {
980 auto optQAbility = jsState.defaultQAbility();
981 if (!optQAbility)
982 return OhosThemeConfig{};
983
984 return OhosThemeConfig{
985 .colorMode = mapOhosConfigurationColorModeFromJs(
986 jsState, optQAbility->eval<QNapi::Number>("context.config.colorMode")),
987 .accentColor = readAccentColor(jsState),
988 };
989 },
990 [](QOhosJsState &jsState, const QNapi::Object &config) {
991 return OhosThemeConfig{
992 .colorMode = mapOhosConfigurationColorModeFromJs(jsState, config.get<QNapi::Number>("colorMode")),
993 .accentColor = readAccentColor(jsState),
994 };
995 },
996 std::move(valueChangedHandler));
997}
998
999std::optional<QPixmap> tryGetFilePixmapByResourceObject(QOhosJsState &jsState, QNapi::Object resource)
1000{
1001 std::string undocumentedParamsPropertyName("params");
1002 auto optParams = QNapi::getOptionalPropOrEmpty<QNapi::Value>(resource, undocumentedParamsPropertyName);
1003 if (optParams.IsEmpty()) {
1004 qOhosPrintfWarning(
1005 "%s: expected '%s' property not found in resource object, ignore getting pixmap",
1006 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1007 return std::nullopt;
1008 }
1009 if (!optParams.IsArray()) {
1010 qOhosPrintfWarning(
1011 "%s: '%s' property is not an array, ignore getting pixmap",
1012 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1013 return std::nullopt;
1014 }
1015
1016 auto params = QNapi::getArrayElements<std::vector<std::string>, QNapi::String>(
1017 QNapi::checkedCast<QNapi::Array>(optParams));
1018 if (params.empty()) {
1019 qOhosPrintfWarning(
1020 "%s: '%s' property is empty, ignore getting pixmap",
1021 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1022 return std::nullopt;
1023 }
1024
1025 const auto resourceIdentifier = params.front();
1026 const auto lastSeparatorPosition = resourceIdentifier.rfind('.');
1027 if (lastSeparatorPosition == std::string::npos) {
1028 qOhosPrintfWarning(
1029 "%s: '%s' property has unknown resource name, ignore getting pixmap",
1030 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1031 return std::nullopt;
1032 }
1033
1034 const auto simpleName = resourceIdentifier.substr(lastSeparatorPosition + 1);
1035 auto resourceContentBuffer = jsState.eval<QNapi::TypedArrayOf<std::uint8_t>>(
1036 "@ohos.resourceManager.getSysResourceManager().getMediaByNameSync(*)", {simpleName});
1037
1038 QPixmap pixmap;
1039 bool pixmapLoadResult = pixmap.loadFromData(
1040 static_cast<const uchar *>(resourceContentBuffer.Data()), resourceContentBuffer.ByteLength());
1041
1042 if (pixmapLoadResult) {
1043 return pixmap;
1044 } else {
1045 qOhosPrintfWarning("%s: cannot load pixmap", Q_FUNC_INFO);
1046 return std::nullopt;
1047 }
1048}
1049
1051 QOhosJsState &jsState, const std::string &filenameExtension)
1052{
1053 std::string ohosDotFilenameExtension = "." + filenameExtension;
1054 auto uniformDataType = jsState.eval<QNapi::String>(
1055 "@ohos.data.uniformTypeDescriptor.getUniformDataTypeByFilenameExtension(*)",
1056 {ohosDotFilenameExtension});
1057
1058 auto resourceValue = jsState.eval(
1059 "@kit.FileManagerServiceKit.fileManagerService.getFileIconSync(*)", {uniformDataType});
1060 if (resourceValue.IsObject()) {
1061 return tryGetFilePixmapByResourceObject(jsState, QNapi::checkedCast<QNapi::Object>(resourceValue));
1062 } else {
1063 qOhosPrintfWarning("%s: got unhandled resource result type, ignore it", Q_FUNC_INFO);
1064 return std::nullopt;
1065 }
1066}
1067
1069{
1070public:
1071 explicit QOhosFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts);
1072
1073protected:
1074 QPixmap filePixmap(const QSize &size, QIcon::Mode mode, QIcon::State) override;
1075};
1076
1077QOhosFileIconEngine::QOhosFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts)
1079{
1080}
1081
1083{
1084 auto fileNameSuffix = fileInfo().suffix();
1085 auto optPixmap = QOhosJsThreadGateway::eval(
1086 [&](QOhosJsState &jsState) {
1087 return tryGetFilePixmapByFilenameExtension(jsState, fileNameSuffix.toStdString());
1088 },
1089 Q_FUNC_INFO);
1090
1091 return optPixmap.has_value()
1092 ? optPixmap.value().scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation)
1093 : QPixmap();
1094}
1095
1096}
1097
1100 []() {
1102 }))
1103 , m_wheelScrollLines(defaultWheelScrollLines)
1104{
1105 auto themeConfigDataSource = std::make_shared<QOhosSupplier<OhosThemeConfig>>(
1106 makeOhosThemeConfigDataSource(
1107 [this](const auto &) {
1108 refreshPalettes();
1109 QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>();
1110 }));
1111
1112 m_ohosConfigDarkModeFlagSupplier = [themeConfigDataSource]() {
1113 return mapOhosConfigurationColorModeToDarkModeFlag((*themeConfigDataSource)().colorMode);
1114 };
1115
1116 m_ohosAccentColorSupplier = [themeConfigDataSource]() {
1117 return (*themeConfigDataSource)().accentColor;
1118 };
1119
1120 refreshPalettes();
1121}
1122
1123void QOhosPlatformTheme::requestColorScheme(Qt::ColorScheme scheme)
1124{
1125 std::optional<bool> isDarkMode = mapOhosThemeFromColorScheme(scheme);
1126 setOhosConfigColorMode(
1127 isDarkMode.has_value()
1128 ? isDarkMode.value()
1132}
1133
1135{
1136 return mapOhosThemeToColorScheme(m_ohosConfigDarkModeFlagSupplier());
1137}
1138
1139void QOhosPlatformTheme::refreshPalettes()
1140{
1141 if (const auto currentColorScheme = colorScheme(); currentColorScheme != Qt::ColorScheme::Unknown)
1142 m_themePalette = makePalettesMap(currentColorScheme, m_ohosAccentColorSupplier());
1143}
1144
1146{
1147 auto _dbg = make_QCScopedDebug("QOhosPlatformTheme::createPlatformDialogHelper");
1148 return QOhosDialogs::createHelper(type);
1149}
1150
1151bool QOhosPlatformTheme::usePlatformNativeDialog(QPlatformTheme::DialogType type) const
1152{
1153 auto _dbg = make_QCScopedDebug("QOhosPlatformTheme::usePlatformNativeDialog");
1154 return (type == QOhosPlatformTheme::FileDialog);
1155}
1156
1158{
1159 switch (hint) {
1160 case StyleNames:
1161 return QStringList(QString::fromUtf8(ohosThemeName));
1162 case MouseDoubleClickDistance:
1163 case TouchDoubleTapDistance:
1164 {
1165 auto *primaryScreen = qGuiApp->primaryScreen();
1166 auto *platformScreen = primaryScreen != nullptr
1167 ? static_cast<QOhosPlatformScreen *>(primaryScreen->handle())
1168 : nullptr;
1169 return platformScreen != nullptr
1170 ? QHighDpi::fromNativePixels(
1171 QHighDpi::toNative(
1172 mouseDoubleClickDistance, platformScreen->pixelScalingCoefficient()),
1173 platformScreen)
1174 : mouseDoubleClickDistance;
1175 }
1176 case MouseDoubleClickInterval:
1178 case WheelScrollLines:
1179 return m_wheelScrollLines;
1180 case MenuBarFocusOnAltPressRelease:
1181 return true;
1182 case PreferFileIconFromTheme:
1183 return true;
1184 default:
1185 return QPlatformTheme::themeHint(hint);
1186 }
1187}
1188
1189const QPalette *QOhosPlatformTheme::palette(Palette type) const
1190{
1191 if (const auto it = m_themePalette.find(type); it != m_themePalette.end())
1192 return &it.value();
1193 return QPlatformTheme::palette(type);
1194}
1195
1196const QFont *QOhosPlatformTheme::font(Font type) const
1197{
1198 const auto fonts = m_fontsSupplier();
1199 const auto fontIter = fonts->find(type);
1200 return fontIter != fonts->end()
1201 ? &fontIter.value()
1202 : QPlatformTheme::font(type);
1203}
1204
1205void QOhosPlatformTheme::setWheelScrollLines(int wheelScrollLines)
1206{
1207 m_wheelScrollLines = wheelScrollLines;
1208}
1209
1211{
1212 return makeQOhosSystemTrayIcon().release();
1213}
1214
1215QIcon QOhosPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const
1216{
1217 return !fileInfo.suffix().isEmpty()
1218 ? QIcon(new QOhosFileIconEngine(fileInfo, iconOptions))
1219 : QPlatformTheme::fileIcon(fileInfo, iconOptions);
1220}
1221
1222QIconEngine *QOhosPlatformTheme::createIconEngine(const QString &iconName) const
1223{
1224 return tryCreateQOhosIconEngine(iconName);
1225}
1226
1227QT_END_NAMESPACE
QIconEngine * createIconEngine(const QString &iconName) const override
Factory function for the QIconEngine used by QIcon::fromTheme().
void requestColorScheme(Qt::ColorScheme scheme) override
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const override
Return an icon for fileInfo, observing iconOptions.
Qt::ColorScheme colorScheme() const override
void setWheelScrollLines(int wheelScrollLines)
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
const QFont * font(Font type) const override
const QPalette * palette(Palette type) const override
Return a color palette for type type.
QPlatformSystemTrayIcon * createPlatformSystemTrayIcon() const override
Factory function for QSystemTrayIcon.
static constexpr int defaultWheelScrollLines
QVariant themeHint(ThemeHint hint) const override
QPixmap filePixmap(const QSize &size, QIcon::Mode mode, QIcon::State) override
QOhosFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts)
Combined button and popup list for selecting options.
AllPalletesColors makeAllPalettesColorsLight(const QColor &accentColor)
SystemPaletteColors makeSystemButtonPaletteColorsDark()
QPalette makeLabelPalette(const AllPalletesColors &palettesColors)
QPalette makeCheckBoxOrRadioButtonPalette(const AllPalletesColors &palettesColors)
ComboBoxPaletteColors makeComboBoxPaletteColorsLight()
ComboBoxPaletteColors makeComboBoxPaletteColorsDark()
QPalette makeSystemPalette(const AllPalletesColors &palettesColors)
SystemPaletteColors makeSystemButtonPaletteColorsLight()
QColor makeInactiveOrDisabledFromColor(const QColor &color)
QHash< QPlatformTheme::Palette, QPalette > makePalettesMap(Qt::ColorScheme scheme, const QColor &accentColor)
QPalette makeTextEditPalette(const AllPalletesColors &palettesColors)
QColor readAccentColor(QOhosJsState &jsState)
TooltipPaletteColors makeTooltipPaletteColorsDark()
QPalette makePalette(const QPalette &basePalette, std::initializer_list< std::tuple< QPalette::ColorGroup, QPalette::ColorRole, const QColor & > > brushEntries)
std::optional< QPixmap > tryGetFilePixmapByResourceObject(QOhosJsState &jsState, QNapi::Object resource)
PalettesColors makePalettesColorsLight(const QColor &accentColor)
AllPalletesColors makeAllPalettesColorsDark(const QColor &accentColor)
void setOhosConfigColorMode(OhosConfigurationColorMode colorMode)
ButtonPaletteColors makeButtonPaletteColorsDark(const QColor &accentColor)
std::optional< bool > mapOhosConfigurationColorModeToDarkModeFlag(OhosConfigurationColorMode colorMode)
QPalette makeBasePalette(const AllPalletesColors &palettesColors)
MenuPaletteColors makeMenuPaletteColorsDark(const PalettesColors &palettes)
QColor makeOverlayCompositedOnSurface(const QColor &overlay, const QColor &surface)
TooltipPaletteColors makeTooltipPaletteColorsLight()
QtOhosQpa::enums::ohos::app::ability::ConfigurationConstant::ColorMode OhosConfigurationColorMode
ToolButtonPaletteColors makeToolButtonPaletteColorsDark()
GroupboxPaletteColors makeGroupboxPaletteColorsDark()
std::optional< QPixmap > tryGetFilePixmapByFilenameExtension(QOhosJsState &jsState, const std::string &filenameExtension)
TabBarPaletteColors makeTabBarPaletteColorsLight(const QColor &accentColor)
QPalette makeHeaderPalette(const AllPalletesColors &palettesColors)
QHash< QPlatformTheme::Font, QFont > makeFontsMap()
AllPalletesColors makeAllPalettesColors(Qt::ColorScheme scheme, const QColor &accentColor)
MenuPaletteColors makeMenuPaletteColorsLight(const PalettesColors &palettes)
OhosConfigurationColorMode mapOhosConfigurationColorModeFromJs(QOhosJsState &jsState, QNapi::Number colorModeJsEnum)
QPalette makeItemViewPalette(const AllPalletesColors &palettesColors)
constexpr int mouseDoubleClickInterval
constexpr int mouseDoubleClickDistance
Qt::ColorScheme mapOhosThemeToColorScheme(std::optional< bool > darkModeFlag)
PalettesColors makePalettesColorsDark(const QColor &accentColor)
QPalette makeTabBarPalette(const AllPalletesColors &palettesColors)
ToolButtonPaletteColors makeToolButtonPaletteColorsLight()
TextLineEditPaletteColors makeTextLineEditPaletteColorsLight()
QPalette makeMenuBarPalette(const AllPalletesColors &palettesColors)
QOhosSupplier< OhosThemeConfig > makeOhosThemeConfigDataSource(QOhosConsumer< OhosThemeConfig > valueChangedHandler)
std::optional< bool > mapOhosThemeFromColorScheme(Qt::ColorScheme scheme)
HeaderPaletteColors makeHeaderPaletteColorsDark()
TabBarPaletteColors makeTabBarPaletteColorsDark(const QColor &accentColor)
QPalette makeComboBoxPalette(const AllPalletesColors &palettesColors)
TextLineEditPaletteColors makeTextLineEditPaletteColorsDark()
ButtonPaletteColors makeButtonPaletteColorsLight(const QColor &accentColor)
QPalette makeMenuPalette(const AllPalletesColors &palettesColors)
HeaderPaletteColors makeHeaderPaletteColorsLight()
QPalette makeGroupBoxPalette(const AllPalletesColors &palettesColors)
QPalette makeButtonPalette(const AllPalletesColors &palettesColors)
QPalette makeTextLineEditPalette(const AllPalletesColors &palettesColors)
QPalette makeToolTipPalette(const AllPalletesColors &palettesColors)
GroupboxPaletteColors makeGroupboxPaletteColorsLight()
QPalette makeToolButtonPalette(const AllPalletesColors &palettesColors)
bool isOhosNoUiChildMode()
bool operator!=(const OhosThemeConfig &other) const
bool operator==(const OhosThemeConfig &other) const