aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2022-06-02 18:41:50 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-09 09:02:28 +0000
commita5931ffc62d51b30db592bfd1dde2ad2d1b56242 (patch)
tree0e0ef5af0b08747fd777ed12190fe3ea637c21cd /src
parentba94296448f48633d1277c98737fe093da9c927b (diff)
iOS Style: Add some more colors to the palette and minor adjustments
Change-Id: Ie6a3eb4b59fb586ad5c48f25d5fe04fcab28bec9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 76ba0738bd346ed76b9bfa5fafb409f18a187e2b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/quickcontrols2/ios/CheckDelegate.qml2
-rw-r--r--src/quickcontrols2/ios/ItemDelegate.qml2
-rw-r--r--src/quickcontrols2/ios/RadioDelegate.qml2
-rw-r--r--src/quickcontrols2/ios/SwipeDelegate.qml2
-rw-r--r--src/quickcontrols2/ios/SwitchDelegate.qml2
-rw-r--r--src/quickcontrols2/ios/qquickiostheme.mm59
6 files changed, 42 insertions, 27 deletions
diff --git a/src/quickcontrols2/ios/CheckDelegate.qml b/src/quickcontrols2/ios/CheckDelegate.qml
index 6481af277d..02fd26d7ce 100644
--- a/src/quickcontrols2/ios/CheckDelegate.qml
+++ b/src/quickcontrols2/ios/CheckDelegate.qml
@@ -91,7 +91,7 @@ T.CheckDelegate {
background: Rectangle {
implicitHeight: 44
- color: control.IOS.theme === IOS.Dark ? control.palette.dark : control.palette.base
+ color: control.IOS.theme === IOS.Dark ? control.palette.light : control.palette.base
NinePatchImage {
property real offset: control.icon.source.toString() !== "" ? control.icon.width + control.spacing : 0
x: control.down ? 0 : control.leftPadding + offset
diff --git a/src/quickcontrols2/ios/ItemDelegate.qml b/src/quickcontrols2/ios/ItemDelegate.qml
index e0f60f70a9..e744e635d6 100644
--- a/src/quickcontrols2/ios/ItemDelegate.qml
+++ b/src/quickcontrols2/ios/ItemDelegate.qml
@@ -72,7 +72,7 @@ T.ItemDelegate {
background: Rectangle {
implicitHeight: 44
- color: control.IOS.theme === IOS.Dark ? control.palette.dark : control.palette.base
+ color: control.IOS.theme === IOS.Dark ? control.palette.light : control.palette.base
NinePatchImage {
property real offset: control.icon.source.toString() !== "" ? control.icon.width + control.spacing : 0
x: control.down ? 0 : control.leftPadding + offset
diff --git a/src/quickcontrols2/ios/RadioDelegate.qml b/src/quickcontrols2/ios/RadioDelegate.qml
index c738b9e5d9..98e548f622 100644
--- a/src/quickcontrols2/ios/RadioDelegate.qml
+++ b/src/quickcontrols2/ios/RadioDelegate.qml
@@ -91,7 +91,7 @@ T.RadioDelegate {
background: Rectangle {
implicitHeight: 44
- color: control.IOS.theme === IOS.Dark ? control.palette.dark : control.palette.base
+ color: control.IOS.theme === IOS.Dark ? control.palette.light : control.palette.base
NinePatchImage {
property real offset: control.icon.source.toString() !== "" ? control.icon.width + control.spacing : 0
x: control.down ? 0 : control.leftPadding + offset
diff --git a/src/quickcontrols2/ios/SwipeDelegate.qml b/src/quickcontrols2/ios/SwipeDelegate.qml
index bf2f1555c4..83763adb23 100644
--- a/src/quickcontrols2/ios/SwipeDelegate.qml
+++ b/src/quickcontrols2/ios/SwipeDelegate.qml
@@ -75,7 +75,7 @@ T.SwipeDelegate {
background: Rectangle {
implicitHeight: 44
- color: control.IOS.theme === IOS.Dark ? control.palette.dark : control.palette.base
+ color: control.IOS.theme === IOS.Dark ? control.palette.light : control.palette.base
NinePatchImage {
property real offset: control.icon.source.toString() !== "" ? control.icon.width + control.spacing : 0
x: control.down ? 0 : control.leftPadding + offset
diff --git a/src/quickcontrols2/ios/SwitchDelegate.qml b/src/quickcontrols2/ios/SwitchDelegate.qml
index 275069e280..56f5dcd26d 100644
--- a/src/quickcontrols2/ios/SwitchDelegate.qml
+++ b/src/quickcontrols2/ios/SwitchDelegate.qml
@@ -120,7 +120,7 @@ T.SwitchDelegate {
background: Rectangle {
implicitHeight: 44
- color: control.IOS.theme === IOS.Dark ? control.palette.dark : control.palette.base
+ color: control.IOS.theme === IOS.Dark ? control.palette.light : control.palette.base
NinePatchImage {
property real offset: control.icon.source.toString() !== "" ? control.icon.width + control.spacing : 0
x: control.leftPadding + offset
diff --git a/src/quickcontrols2/ios/qquickiostheme.mm b/src/quickcontrols2/ios/qquickiostheme.mm
index 0395edbaff..27aa3128c6 100644
--- a/src/quickcontrols2/ios/qquickiostheme.mm
+++ b/src/quickcontrols2/ios/qquickiostheme.mm
@@ -54,47 +54,62 @@ void QQuickIOSTheme::initialize(QQuickTheme *theme)
{
QPalette systemPalette;
+ QColor window;
+ QColor windowText;
QColor background;
QColor placeholderText;
- QColor blue;
+ QColor button;
+ QColor disabledButton;
QColor white;
- QColor disabled;
- QColor grey;
- QColor dark;
+ QColor lightGray;
+ QColor gray;
+ QColor darkGray;
#ifdef Q_OS_IOS
+ window = qt_mac_toQColor(UIColor.systemGroupedBackgroundColor.CGColor);
+ windowText = qt_mac_toQColor(UIColor.labelColor.CGColor);
background = qt_mac_toQColor(UIColor.systemBackgroundColor.CGColor);
placeholderText = qt_mac_toQColor(UIColor.placeholderTextColor.CGColor);
- blue = qt_mac_toQColor(UIColor.systemBlueColor.CGColor);
- disabled = qt_mac_toQColor(UIColor.tertiarySystemFillColor.CGColor);
+ button = qt_mac_toQColor(UIColor.systemBlueColor.CGColor);
+ disabledButton = qt_mac_toQColor(UIColor.tertiarySystemFillColor.CGColor);
white = qt_mac_toQColor(UIColor.whiteColor.CGColor);
- grey = qt_mac_toQColor(UIColor.opaqueSeparatorColor.CGColor);
- dark = qt_mac_toQColor(UIColor.systemGray6Color.CGColor);
+ lightGray = qt_mac_toQColor(UIColor.systemGray6Color.CGColor);
+ gray = qt_mac_toQColor(UIColor.opaqueSeparatorColor.CGColor);
+ darkGray = qt_mac_toQColor(UIColor.systemGrayColor.CGColor);
#else
- background = QQuickStylePrivate::isDarkSystemTheme() ? QColor(Qt::black) : QColor(Qt::white);
- placeholderText = QColor(qRgba(60, 60, 67, 77));
- blue = QColor(qRgba(0, 122, 255, 255));
- white = QColor(qRgba(255, 255, 255, 255));
- disabled = QColor(qRgba(118, 118, 128, 31));
- grey = QColor(qRgba(142, 142, 147, 255));
- dark = QColor(qRgba(28, 28, 30, 255));
+ bool isDarkSystemTheme = QQuickStylePrivate::isDarkSystemTheme();
+ window = isDarkSystemTheme ? QColor(qRgba(0, 0, 0, 255)) : QColor(qRgba(242, 242, 247, 255));
+ windowText = isDarkSystemTheme ? QColor(Qt::white) : QColor(Qt::black);
+ background = isDarkSystemTheme ? QColor(Qt::black) : QColor(Qt::white);
+ placeholderText = isDarkSystemTheme ? QColor(qRgba(235, 235, 245, 77)) : QColor(qRgba(60, 60, 67, 77));
+ button = isDarkSystemTheme ? QColor(qRgba(10, 132, 255, 255)) : QColor(qRgba(0, 122, 255, 255));
+ disabledButton = isDarkSystemTheme ? QColor(qRgba(118, 118, 128, 61)) : QColor(qRgba(118, 118, 128, 31));
+ white = QColor(Qt::white);
+ lightGray = isDarkSystemTheme ? QColor(qRgba(28, 28, 30, 255)) : QColor(qRgba(242, 242, 247, 255));
+ gray = isDarkSystemTheme ? QColor(qRgba(56, 56, 58, 255)) : QColor(qRgba(198, 198, 200, 2555));
+ darkGray = QColor(qRgba(142, 142, 147, 255));
#endif
- systemPalette.setColor(QPalette::Window, background);
+ systemPalette.setColor(QPalette::Window, window);
+
+ systemPalette.setColor(QPalette::Active, QPalette::WindowText, windowText);
+ systemPalette.setColor(QPalette::Disabled, QPalette::WindowText, darkGray);
+
systemPalette.setColor(QPalette::Base, background);
systemPalette.setColor(QPalette::PlaceholderText, placeholderText);
- systemPalette.setColor(QPalette::Button, blue);
- systemPalette.setColor(QPalette::Disabled, QPalette::Button, disabled);
+ systemPalette.setColor(QPalette::Button, button);
+ systemPalette.setColor(QPalette::Disabled, QPalette::Button, disabledButton);
systemPalette.setColor(QPalette::ButtonText, white);
white.setAlphaF(0.5);
systemPalette.setColor(QPalette::Disabled, QPalette::ButtonText, white);
- blue.setAlphaF(0.8);
- systemPalette.setColor(QPalette::Highlight, blue);
+ button.setAlphaF(0.8);
+ systemPalette.setColor(QPalette::Highlight, button);
- systemPalette.setColor(QPalette::Mid, grey);
- systemPalette.setColor(QPalette::Dark, dark);
+ systemPalette.setColor(QPalette::Light, lightGray);
+ systemPalette.setColor(QPalette::Mid, gray);
+ systemPalette.setColor(QPalette::Dark, darkGray);
theme->setPalette(QQuickTheme::System, systemPalette);
}