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 });
549}
550
552{
553 return makePalette(
554 makeBasePalette(palettesColors),
555 {
556 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
557 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
558 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
559 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.highlighted},
560 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.highlighted},
561 {QPalette::Inactive, QPalette::WindowText, palettesColors.palettes.inactiveText},
562 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.inactiveHighlighted},
563 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
564 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
565 });
566}
567
569{
570 return makePalette(
571 makeBasePalette(palettesColors),
572 {
573 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.componentActivated},
574 {QPalette::All, QPalette::Base, palettesColors.palettes.window},
575 {QPalette::All, QPalette::Window, palettesColors.palettes.window},
576 {QPalette::Active, QPalette::Text, palettesColors.palettes.highlighted},
577 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveText},
578 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.inactiveHighlighted},
579 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
580 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
581 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.indicatorArrow},
582 {QPalette::All, QPalette::Button, palettesColors.comboBox.buttonBackground}
583 });
584}
585
587{
588 return makePalette(
589 makeBasePalette(palettesColors),
590 {
591 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
592 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
593 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
594 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
595
596 {QPalette::Active, QPalette::Text, palettesColors.palettes.textPrimary},
597 {QPalette::Disabled, QPalette::Text, palettesColors.menu.inactiveText},
598 {QPalette::Inactive, QPalette::Text, palettesColors.menu.inactiveText},
599
600 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
601 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
602
603 {QPalette::Active, QPalette::Mid, palettesColors.menu.listSeparator}
604 });
605}
606
608{
609 return makePalette(
610 makeBasePalette(palettesColors),
611 {
612 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.textPrimary},
613 {QPalette::Disabled, QPalette::ButtonText, palettesColors.menu.inactiveText},
614 {QPalette::Inactive, QPalette::ButtonText, palettesColors.menu.inactiveText},
615 });
616}
617
619{
620 return makePalette(
621 makeBasePalette(palettesColors),
622 {
623 {QPalette::Active, QPalette::WindowText, palettesColors.tabBar.activeWindowText},
624 {QPalette::Inactive, QPalette::WindowText, palettesColors.tabBar.inactiveWindowText},
625 {QPalette::Disabled, QPalette::WindowText, palettesColors.tabBar.disabledWindowText},
626
627 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
628 {QPalette::Inactive, QPalette::Window, palettesColors.palettes.inactiveWindow},
629 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.inactiveWindow},
630
631 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.activeHighlight},
632 {QPalette::Inactive, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
633 {QPalette::Disabled, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
634 });
635}
636
638{
639 return makePalette(
640 makeSystemPalette(palettesColors),
641 {
642 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.componentActivated},
643 {QPalette::All, QPalette::Base, palettesColors.textLineEdit.textEditBackground},
644 {QPalette::Disabled, QPalette::Base, palettesColors.textLineEdit.inactiveTextEditBackground},
645 {QPalette::All, QPalette::Text, palettesColors.palettes.textPrimary},
646 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.disabledTextPrimary},
647 });
648}
649
651{
652 return makePalette(
653 makeTextLineEditPalette(palettesColors),
654 {
655 {QPalette::All, QPalette::Base, palettesColors.palettes.activeWindow},
656 });
657}
658
660{
661 return makePalette(
662 makeBasePalette(palettesColors),
663 {
664 {QPalette::Active, QPalette::Button, palettesColors.palettes.highlighted},
665 {QPalette::Inactive, QPalette::Button, palettesColors.palettes.switchOutlineOff},
666 {QPalette::Active, QPalette::Base, palettesColors.system.activeWindowFrame},
667 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.switchBgOff},
668 {QPalette::Active, QPalette::AlternateBase, palettesColors.groupBox.groupBoxFrame},
669 {QPalette::Active, QPalette::Window, palettesColors.groupBox.background},
670 {QPalette::Inactive, QPalette::Window, palettesColors.groupBox.background},
671 {QPalette::Active, QPalette::Window, palettesColors.palettes.window},
672 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.window},
673 {QPalette::Active, QPalette::Text, palettesColors.palettes.highlighted},
674 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.highlighted},
675 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveHighlighted},
676 {QPalette::Current, QPalette::Text, palettesColors.palettes.highlighted},
677 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.inactiveHighlighted},
678 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.textPrimary},
679 {QPalette::Disabled, QPalette::ButtonText, palettesColors.palettes.inactiveHighlighted},
680 {QPalette::Active, QPalette::Dark, palettesColors.palettes.clickEffect},
681 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
682 {QPalette::Active, QPalette::Shadow, palettesColors.groupBox.shadowXS},
683 {QPalette::Active, QPalette::Midlight, palettesColors.palettes.scrollBarSlider},
684 {QPalette::Active, QPalette::Mid, palettesColors.palettes.componentNormal}
685 });
686}
687
689{
690 return makePalette(
691 makeBasePalette(palettesColors),
692 {
693 {QPalette::Active, QPalette::Button, palettesColors.header.activeButton},
694 {QPalette::Inactive, QPalette::Button, palettesColors.header.activeButton},
695 {QPalette::Disabled, QPalette::Button, palettesColors.palettes.inactiveWindow},
696
697 {QPalette::Current, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
698 {QPalette::Active, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
699 {QPalette::Inactive, QPalette::ButtonText, palettesColors.palettes.activeButtonText},
700 {QPalette::Disabled, QPalette::ButtonText, palettesColors.palettes.inactiveButtonText},
701 });
702}
703
705{
706 return makePalette(
707 makeSystemPalette(palettesColors),
708 {
709 {QPalette::Active, QPalette::Base, palettesColors.palettes.window},
710 {QPalette::Inactive, QPalette::Base, palettesColors.palettes.window},
711 {QPalette::Disabled, QPalette::Base, palettesColors.palettes.window},
712
713 {QPalette::Active, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
714 {QPalette::Inactive, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
715 {QPalette::Disabled, QPalette::AlternateBase, palettesColors.palettes.inactiveWindow},
716 {QPalette::Current, QPalette::AlternateBase, palettesColors.palettes.activeWindow},
717
718 {QPalette::Active, QPalette::Highlight, palettesColors.palettes.activeHighlight},
719 {QPalette::Inactive, QPalette::Highlight, palettesColors.palettes.activeHighlight},
720 {QPalette::Disabled, QPalette::Highlight, palettesColors.palettes.inactiveHighlight},
721
722 {QPalette::Active, QPalette::Window, palettesColors.palettes.activeWindow},
723 {QPalette::Inactive, QPalette::Window, palettesColors.palettes.activeWindow},
724 {QPalette::Disabled, QPalette::Window, palettesColors.palettes.inactiveWindow},
725
726 {QPalette::Active, QPalette::Text, palettesColors.palettes.activeHighlight},
727 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.activeHighlight},
728 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.inactiveHighlight},
729
730 {QPalette::Active, QPalette::HighlightedText, palettesColors.palettes.activeWindow},
731 {QPalette::Inactive, QPalette::HighlightedText, palettesColors.palettes.activeWindow},
732 {QPalette::Disabled, QPalette::HighlightedText, palettesColors.palettes.inactiveWindow},
733
734 {QPalette::Active, QPalette::Dark, palettesColors.palettes.activeWindow},
735 {QPalette::Inactive, QPalette::Dark, palettesColors.palettes.activeWindow},
736 {QPalette::Disabled, QPalette::Dark, palettesColors.palettes.inactiveWindow},
737 {QPalette::Current, QPalette::Dark, palettesColors.palettes.activeWindow},
738 {QPalette::All, QPalette::Dark, palettesColors.palettes.activeWindow},
739
740 {QPalette::Active, QPalette::Light, palettesColors.palettes.hover},
741 {QPalette::Inactive, QPalette::Light, palettesColors.palettes.activeWindow},
742 {QPalette::Disabled, QPalette::Light, palettesColors.palettes.inactiveWindow},
743
744 {QPalette::Active, QPalette::Mid, palettesColors.palettes.activeWindow},
745 {QPalette::Inactive, QPalette::Mid, palettesColors.palettes.activeWindow},
746 {QPalette::Disabled, QPalette::Mid, palettesColors.palettes.inactiveWindow},
747 {QPalette::Current, QPalette::Mid, palettesColors.palettes.activeWindow},
748 {QPalette::All, QPalette::Mid, palettesColors.palettes.activeWindow},
749 });
750}
751
753{
754 return makePalette(
755 makeBasePalette(palettesColors),
756 {
757 {QPalette::Active, QPalette::WindowText, palettesColors.palettes.textPrimary},
758 {QPalette::Disabled, QPalette::WindowText, palettesColors.palettes.disabledTextPrimary},
759 {QPalette::Inactive, QPalette::WindowText, palettesColors.palettes.inactiveTextPrimary},
760
761 {QPalette::Active, QPalette::Text, palettesColors.palettes.textPrimary},
762 {QPalette::Disabled, QPalette::Text, palettesColors.palettes.disabledTextPrimary},
763 {QPalette::Inactive, QPalette::Text, palettesColors.palettes.inactiveTextPrimary},
764 });
765}
766
768{
769 return makePalette(
770 makeBasePalette(palettesColors),
771 {
772 {QPalette::All, QPalette::Base, palettesColors.toolTip.toolTipBorder},
773 {QPalette::All, QPalette::ToolTipBase, palettesColors.toolTip.toolTipBase},
774 {QPalette::All, QPalette::ToolTipText, palettesColors.palettes.highlighted},
775 });
776}
777
779{
780 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
781 font.setPointSize(16);
782
783 return font;
784}
785
787{
788 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
789 font.setPointSize(12);
790 font.setBold(false);
791
792 return font;
793}
794
796{
797 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
798 font.setPointSize(20);
799 font.setBold(true);
800
801 return font;
802}
803
805{
806 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
807 font.setPointSize(16);
808
809 return font;
810}
811
813{
814 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
815 font.setPointSize(16);
816
817 return font;
818}
819
821{
822 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
823 font.setPointSize(16);
824
825 return font;
826}
827
829{
830 auto font = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont();
831 font.setPointSize(14);
832
833 return font;
834}
835
837{
838 return {
839 {QPlatformTheme::DockWidgetTitleFont, makeTitleFont()},
840 {QPlatformTheme::GroupBoxTitleFont, makeGroupBoxTitleFont()},
841 {QPlatformTheme::ListViewFont, makeListViewFont()},
842 {QPlatformTheme::MenuBarFont, makeMenuFont()},
843 {QPlatformTheme::MenuFont, makeMenuFont()},
844 {QPlatformTheme::MenuItemFont, makeMenuFont()},
845 {QPlatformTheme::PushButtonFont, makePushButtonFont()},
846 {QPlatformTheme::SystemFont, makeSystemFont()},
847 {QPlatformTheme::TipLabelFont, makeTipLabelFont()},
848 };
849}
850
851QHash<QPlatformTheme::Palette, QPalette> makePalettesMap(Qt::ColorScheme scheme, const QColor &accentColor)
852{
853 const AllPalletesColors palettesColors = makeAllPalettesColors(scheme, accentColor);
854 return {
855 {QPlatformTheme::ButtonPalette, makeButtonPalette(palettesColors)},
856 {QPlatformTheme::CheckBoxPalette, makeCheckBoxOrRadioButtonPalette(palettesColors)},
857 {QPlatformTheme::ComboBoxPalette, makeComboBoxPalette(palettesColors)},
858 {QPlatformTheme::GroupBoxPalette, makeGroupBoxPalette(palettesColors)},
859 {QPlatformTheme::HeaderPalette, makeHeaderPalette(palettesColors)},
860 {QPlatformTheme::ItemViewPalette, makeItemViewPalette(palettesColors)},
861 {QPlatformTheme::LabelPalette, makeLabelPalette(palettesColors)},
862 {QPlatformTheme::MenuPalette, makeMenuPalette(palettesColors)},
863 {QPlatformTheme::MenuBarPalette, makeMenuBarPalette(palettesColors)},
864 {QPlatformTheme::RadioButtonPalette, makeCheckBoxOrRadioButtonPalette(palettesColors)},
865 {QPlatformTheme::SystemPalette, makeSystemPalette(palettesColors)},
866 {QPlatformTheme::TabBarPalette, makeTabBarPalette(palettesColors)},
867 {QPlatformTheme::TextEditPalette, makeTextEditPalette(palettesColors)},
868 {QPlatformTheme::TextLineEditPalette, makeTextLineEditPalette(palettesColors)},
869 {QPlatformTheme::ToolButtonPalette, makeToolButtonPalette(palettesColors)},
870 {QPlatformTheme::ToolTipPalette, makeToolTipPalette(palettesColors)},
871 };
872}
873
875 Qt::ColorScheme scheme)
876{
877 switch (scheme) {
878 case Qt::ColorScheme::Unknown:
879 return std::nullopt;
880 case Qt::ColorScheme::Light:
881 return false;
882 case Qt::ColorScheme::Dark:
883 return true;
884 };
885 return std::nullopt;
886}
887
889 std::optional<bool> darkModeFlag)
890{
891 if (darkModeFlag.has_value()) {
892 if (!darkModeFlag.value_or(false))
893 return Qt::ColorScheme::Light;
894 else
895 return Qt::ColorScheme::Dark;
896 } else {
897 return Qt::ColorScheme::Unknown;
898 }
899}
900
902
903OhosConfigurationColorMode mapOhosConfigurationColorModeFromJs(QOhosJsState &jsState, QNapi::Number colorModeJsEnum)
904{
905 constexpr auto fallbackColorMode = OhosConfigurationColorMode::COLOR_MODE_NOT_SET;
906 auto optColorMode = jsState.tryMapOhosEnumFromJs<OhosConfigurationColorMode>(colorModeJsEnum);
907 return optColorMode.value_or(fallbackColorMode);
908};
909
911{
913 qCWarning(QtForOhos, "%s: cannot set a color mode in 'no UI child mode'", Q_FUNC_INFO);
914 return;
915 }
916
917 QOhosJsThreadGateway::runAndWait(
918 [&](QOhosJsState &jsState) {
919 auto optQAbility = jsState.defaultQAbility();
920 if (!optQAbility) {
921 qCWarning(QtForOhos, "%s: cannot set a color mode without a UIAbility", Q_FUNC_INFO);
922 return;
923 }
924
925 const auto jsColorMode = jsState.mapOhosEnumToJs(colorMode);
926 optQAbility->eval("context.getApplicationContext().setColorMode(*)", {jsColorMode});
927 },
928 Q_FUNC_INFO);
929}
930
932{
933 switch (colorMode) {
935 return std::nullopt;
937 return false;
939 return true;
940 }
941
942 return std::nullopt;
943}
944
945QColor readAccentColor(QOhosJsState &jsState)
946{
947 auto optQAbility = jsState.defaultQAbility();
948 if (!optQAbility)
949 return {};
950
951 const auto argb = static_cast<uint32_t>(
952 optQAbility->eval<QNapi::Number>(
953 "context.resourceManager.getColorByNameSync(*)",
954 {"ohos_id_color_emphasize"}));
955 return QColor::fromRgba(argb);
956}
957
959{
962
963 bool operator==(const OhosThemeConfig &other) const
964 {
965 return colorMode == other.colorMode && accentColor == other.accentColor;
966 }
967
968 bool operator!=(const OhosThemeConfig &other) const
969 {
970 return !(*this == other);
971 }
972};
973
975 QOhosConsumer<OhosThemeConfig> valueChangedHandler)
976{
977 return QtOhos::makeOhosConfigValueDataSource<OhosThemeConfig>(
978 [](QOhosJsState &jsState) {
979 auto optQAbility = jsState.defaultQAbility();
980 if (!optQAbility)
981 return OhosThemeConfig{};
982
983 return OhosThemeConfig{
984 .colorMode = mapOhosConfigurationColorModeFromJs(
985 jsState, optQAbility->eval<QNapi::Number>("context.config.colorMode")),
986 .accentColor = readAccentColor(jsState),
987 };
988 },
989 [](QOhosJsState &jsState, const QNapi::Object &config) {
990 return OhosThemeConfig{
991 .colorMode = mapOhosConfigurationColorModeFromJs(jsState, config.get<QNapi::Number>("colorMode")),
992 .accentColor = readAccentColor(jsState),
993 };
994 },
995 std::move(valueChangedHandler));
996}
997
998std::optional<QPixmap> tryGetFilePixmapByResourceObject(QOhosJsState &jsState, QNapi::Object resource)
999{
1000 std::string undocumentedParamsPropertyName("params");
1001 auto optParams = QNapi::getOptionalPropOrEmpty<QNapi::Value>(resource, undocumentedParamsPropertyName);
1002 if (optParams.IsEmpty()) {
1003 qOhosPrintfWarning(
1004 "%s: expected '%s' property not found in resource object, ignore getting pixmap",
1005 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1006 return std::nullopt;
1007 }
1008 if (!optParams.IsArray()) {
1009 qOhosPrintfWarning(
1010 "%s: '%s' property is not an array, ignore getting pixmap",
1011 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1012 return std::nullopt;
1013 }
1014
1015 auto params = QNapi::getArrayElements<std::vector<std::string>, QNapi::String>(
1016 QNapi::checkedCast<QNapi::Array>(optParams));
1017 if (params.empty()) {
1018 qOhosPrintfWarning(
1019 "%s: '%s' property is empty, ignore getting pixmap",
1020 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1021 return std::nullopt;
1022 }
1023
1024 const auto resourceIdentifier = params.front();
1025 const auto lastSeparatorPosition = resourceIdentifier.rfind('.');
1026 if (lastSeparatorPosition == std::string::npos) {
1027 qOhosPrintfWarning(
1028 "%s: '%s' property has unknown resource name, ignore getting pixmap",
1029 Q_FUNC_INFO, undocumentedParamsPropertyName.c_str());
1030 return std::nullopt;
1031 }
1032
1033 const auto simpleName = resourceIdentifier.substr(lastSeparatorPosition + 1);
1034 auto resourceContentBuffer = jsState.eval<QNapi::TypedArrayOf<std::uint8_t>>(
1035 "@ohos.resourceManager.getSysResourceManager().getMediaByNameSync(*)", {simpleName});
1036
1037 QPixmap pixmap;
1038 bool pixmapLoadResult = pixmap.loadFromData(
1039 static_cast<const uchar *>(resourceContentBuffer.Data()), resourceContentBuffer.ByteLength());
1040
1041 if (pixmapLoadResult) {
1042 return pixmap;
1043 } else {
1044 qOhosPrintfWarning("%s: cannot load pixmap", Q_FUNC_INFO);
1045 return std::nullopt;
1046 }
1047}
1048
1050 QOhosJsState &jsState, const std::string &filenameExtension)
1051{
1052 std::string ohosDotFilenameExtension = "." + filenameExtension;
1053 auto uniformDataType = jsState.eval<QNapi::String>(
1054 "@ohos.data.uniformTypeDescriptor.getUniformDataTypeByFilenameExtension(*)",
1055 {ohosDotFilenameExtension});
1056
1057 auto resourceValue = jsState.eval(
1058 "@kit.FileManagerServiceKit.fileManagerService.getFileIconSync(*)", {uniformDataType});
1059 if (resourceValue.IsObject()) {
1060 return tryGetFilePixmapByResourceObject(jsState, QNapi::checkedCast<QNapi::Object>(resourceValue));
1061 } else {
1062 qOhosPrintfWarning("%s: got unhandled resource result type, ignore it", Q_FUNC_INFO);
1063 return std::nullopt;
1064 }
1065}
1066
1068{
1069public:
1070 explicit QOhosFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts);
1071
1072protected:
1073 QPixmap filePixmap(const QSize &size, QIcon::Mode mode, QIcon::State) override;
1074};
1075
1076QOhosFileIconEngine::QOhosFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts)
1078{
1079}
1080
1082{
1083 auto fileNameSuffix = fileInfo().suffix();
1084 auto optPixmap = QOhosJsThreadGateway::eval(
1085 [&](QOhosJsState &jsState) {
1086 return tryGetFilePixmapByFilenameExtension(jsState, fileNameSuffix.toStdString());
1087 },
1088 Q_FUNC_INFO);
1089
1090 return optPixmap.has_value()
1091 ? optPixmap.value().scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation)
1092 : QPixmap();
1093}
1094
1095}
1096
1099 []() {
1101 }))
1102 , m_wheelScrollLines(defaultWheelScrollLines)
1103{
1104 auto themeConfigDataSource = std::make_shared<QOhosSupplier<OhosThemeConfig>>(
1105 makeOhosThemeConfigDataSource(
1106 [this](const auto &) {
1107 refreshPalettes();
1108 QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>();
1109 }));
1110
1111 m_ohosConfigDarkModeFlagSupplier = [themeConfigDataSource]() {
1112 return mapOhosConfigurationColorModeToDarkModeFlag((*themeConfigDataSource)().colorMode);
1113 };
1114
1115 m_ohosAccentColorSupplier = [themeConfigDataSource]() {
1116 return (*themeConfigDataSource)().accentColor;
1117 };
1118
1119 refreshPalettes();
1120}
1121
1122void QOhosPlatformTheme::requestColorScheme(Qt::ColorScheme scheme)
1123{
1124 std::optional<bool> isDarkMode = mapOhosThemeFromColorScheme(scheme);
1125 setOhosConfigColorMode(
1126 isDarkMode.has_value()
1127 ? isDarkMode.value()
1131}
1132
1134{
1135 return mapOhosThemeToColorScheme(m_ohosConfigDarkModeFlagSupplier());
1136}
1137
1138void QOhosPlatformTheme::refreshPalettes()
1139{
1140 if (const auto currentColorScheme = colorScheme(); currentColorScheme != Qt::ColorScheme::Unknown)
1141 m_themePalette = makePalettesMap(currentColorScheme, m_ohosAccentColorSupplier());
1142}
1143
1145{
1146 auto _dbg = make_QCScopedDebug("QOhosPlatformTheme::createPlatformDialogHelper");
1147 return QOhosDialogs::createHelper(type);
1148}
1149
1150bool QOhosPlatformTheme::usePlatformNativeDialog(QPlatformTheme::DialogType type) const
1151{
1152 auto _dbg = make_QCScopedDebug("QOhosPlatformTheme::usePlatformNativeDialog");
1153 return (type == QOhosPlatformTheme::FileDialog);
1154}
1155
1157{
1158 switch (hint) {
1159 case StyleNames:
1160 return QStringList(QString::fromUtf8(ohosThemeName));
1161 case MouseDoubleClickDistance:
1162 case TouchDoubleTapDistance:
1163 {
1164 auto *primaryScreen = qGuiApp->primaryScreen();
1165 auto *platformScreen = primaryScreen != nullptr
1166 ? static_cast<QOhosPlatformScreen *>(primaryScreen->handle())
1167 : nullptr;
1168 return platformScreen != nullptr
1169 ? QHighDpi::fromNativePixels(
1170 QHighDpi::toNative(
1171 mouseDoubleClickDistance, platformScreen->pixelScalingCoefficient()),
1172 platformScreen)
1173 : mouseDoubleClickDistance;
1174 }
1175 case MouseDoubleClickInterval:
1177 case WheelScrollLines:
1178 return m_wheelScrollLines;
1179 case MenuBarFocusOnAltPressRelease:
1180 return true;
1181 case PreferFileIconFromTheme:
1182 return true;
1183 default:
1184 return QPlatformTheme::themeHint(hint);
1185 }
1186}
1187
1188const QPalette *QOhosPlatformTheme::palette(Palette type) const
1189{
1190 if (const auto it = m_themePalette.find(type); it != m_themePalette.end())
1191 return &it.value();
1192 return QPlatformTheme::palette(type);
1193}
1194
1195const QFont *QOhosPlatformTheme::font(Font type) const
1196{
1197 const auto fonts = m_fontsSupplier();
1198 const auto fontIter = fonts->find(type);
1199 return fontIter != fonts->end()
1200 ? &fontIter.value()
1201 : QPlatformTheme::font(type);
1202}
1203
1204void QOhosPlatformTheme::setWheelScrollLines(int wheelScrollLines)
1205{
1206 m_wheelScrollLines = wheelScrollLines;
1207}
1208
1210{
1211 return makeQOhosSystemTrayIcon().release();
1212}
1213
1214QIcon QOhosPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const
1215{
1216 return !fileInfo.suffix().isEmpty()
1217 ? QIcon(new QOhosFileIconEngine(fileInfo, iconOptions))
1218 : QPlatformTheme::fileIcon(fileInfo, iconOptions);
1219}
1220
1221QIconEngine *QOhosPlatformTheme::createIconEngine(const QString &iconName) const
1222{
1223 return tryCreateQOhosIconEngine(iconName);
1224}
1225
1226QT_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