diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-12-30 18:09:39 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-01 11:35:39 -0800 |
commit | 4ca40bc15262193cec29f1aea02ac6964634b88c (patch) | |
tree | 342580d7a4d44c6567d1862c977e3f9ffe6798cd | |
parent | 765c4f9704e2b606a94fedff3e3fdf7deeefa2f6 (diff) | |
download | subsurface-4ca40bc15262193cec29f1aea02ac6964634b88c.tar.gz |
mobile/UI: consolidate to a single check box
It was very odd that we had two slightly different styled check boxes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DiveDetailsEdit.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/DownloadedDiveDelegate.qml | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/SsrfCheckBox.qml | 29 | ||||
-rw-r--r-- | mobile-widgets/qml/TemplateCheckBox.qml | 11 | ||||
-rw-r--r-- | mobile-widgets/qml/mobile-resources.qrc | 1 |
6 files changed, 8 insertions, 39 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index f4550b3b4..ededf8196 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -192,7 +192,7 @@ Item { text: qsTr("Use current\nGPS location:") visible: manager.locationServiceAvailable } - SsrfCheckBox { + TemplateCheckBox { id: checkboxGPS visible: manager.locationServiceAvailable onCheckedChanged: { diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 47d6f78d7..3346ad5c0 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -401,7 +401,7 @@ Kirigami.Page { Layout.fillWidth: true Layout.topMargin: 0 spacing: Kirigami.Units.smallSpacing - SsrfCheckBox { + TemplateCheckBox { id: forceAll checked: manager.DC_forceDownload enabled: forceAllLabel.visible diff --git a/mobile-widgets/qml/DownloadedDiveDelegate.qml b/mobile-widgets/qml/DownloadedDiveDelegate.qml index 6a3136975..6408d9bd2 100644 --- a/mobile-widgets/qml/DownloadedDiveDelegate.qml +++ b/mobile-widgets/qml/DownloadedDiveDelegate.qml @@ -34,7 +34,7 @@ Kirigami.AbstractListItem { NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 } NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 } } - SsrfCheckBox { + TemplateCheckBox { id: diveIsSelected checked: innerListItem.selected; width: childrenRect.width + 4 * Kirigami.Units.smallSpacing; diff --git a/mobile-widgets/qml/SsrfCheckBox.qml b/mobile-widgets/qml/SsrfCheckBox.qml deleted file mode 100644 index e110dc5f0..000000000 --- a/mobile-widgets/qml/SsrfCheckBox.qml +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -import QtQuick 2.6 -import QtQuick.Controls 2.2 -import org.subsurfacedivelog.mobile 1.0 -import org.kde.kirigami 2.4 as Kirigami - -CheckBox { - id: root - indicator: Rectangle { - implicitWidth: 20 * PrefDisplay.mobile_scale - implicitHeight: 20 * PrefDisplay.mobile_scale - x: root.leftPadding - y: parent.height / 2 - height / 2 - radius: 4 - border.color: root.down ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor - border.width: 2 - color: subsurfaceTheme.backgroundColor - - Rectangle { - width: 12 * PrefDisplay.mobile_scale - height: 12 * PrefDisplay.mobile_scale - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - radius: 3 - color: root.down ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor - visible: root.checked - } - } -} diff --git a/mobile-widgets/qml/TemplateCheckBox.qml b/mobile-widgets/qml/TemplateCheckBox.qml index 85aa0bef1..1ae48eb8b 100644 --- a/mobile-widgets/qml/TemplateCheckBox.qml +++ b/mobile-widgets/qml/TemplateCheckBox.qml @@ -6,23 +6,22 @@ import org.kde.kirigami 2.4 as Kirigami CheckBox { id: cb - indicator: Rectangle { implicitWidth: Kirigami.Units.gridUnit implicitHeight: Kirigami.Units.gridUnit x: cb.leftPadding y: parent.height / 2 - height / 2 - radius: 3 + radius: 4 + border.color: cb.down ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor + border.width: 2 color: subsurfaceTheme.backgroundColor - border.color: subsurfaceTheme.textColor - Rectangle { width: parent.width / 2 height: width x: width / 2 y: width / 2 - radius: 2 - color: subsurfaceTheme.textColor + radius: 3 + color: cb.down ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor visible: cb.checked } } diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index debafd80b..00ef4f868 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -44,7 +44,6 @@ <file>StartPage.qml</file> <file>RecoverCache.qml</file> - <file>SsrfCheckBox.qml</file> <file>SsrfSwitch.qml</file> <file>SsrfTextField.qml</file> |