1// Copyright (C) 2017 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 "qquickimaginetheme_p.h"
5
6#include <QtQuickTemplates2/private/qquicktheme_p.h>
7
8QT_BEGIN_NAMESPACE
9
10void QQuickImagineTheme::initialize(QQuickTheme *theme)
11{
12 QFont systemFont;
13 systemFont.setFamilies(QStringList{QLatin1String("Open Sans")});
14 theme->setFont(scope: QQuickTheme::System, font: systemFont);
15
16 const QColor accentColor = QColor::fromRgb(rgb: 0x4fc1e9);
17 const QColor windowTextColor = QColor::fromRgb(rgb: 0x434a54);
18 const QColor disabledWindowTextColor = QColor::fromRgb(rgb: 0xccd1d9);
19
20 QPalette systemPalette;
21 systemPalette.setColor(acr: QPalette::ButtonText, acolor: Qt::white);
22 systemPalette.setColor(acr: QPalette::BrightText, acolor: Qt::white);
23 systemPalette.setColor(acr: QPalette::Highlight, acolor: accentColor);
24 systemPalette.setColor(acr: QPalette::HighlightedText, acolor: Qt::white);
25 systemPalette.setColor(acr: QPalette::Text, acolor: windowTextColor);
26 systemPalette.setColor(acr: QPalette::ToolTipText, acolor: Qt::white);
27 systemPalette.setColor(acr: QPalette::WindowText, acolor: windowTextColor);
28 systemPalette.setColor(acg: QPalette::Disabled, acr: QPalette::Text, acolor: disabledWindowTextColor);
29 systemPalette.setColor(acg: QPalette::Disabled, acr: QPalette::WindowText, acolor: disabledWindowTextColor);
30 theme->setPalette(scope: QQuickTheme::System, palette: systemPalette);
31}
32
33QT_END_NAMESPACE
34

source code of qtdeclarative/src/quickcontrols/imagine/qquickimaginetheme.cpp