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>
This commit is contained in:
Dirk Hohndel 2020-12-30 18:09:39 -08:00
parent 765c4f9704
commit 4ca40bc152
6 changed files with 8 additions and 39 deletions

View file

@ -192,7 +192,7 @@ Item {
text: qsTr("Use current\nGPS location:")
visible: manager.locationServiceAvailable
}
SsrfCheckBox {
TemplateCheckBox {
id: checkboxGPS
visible: manager.locationServiceAvailable
onCheckedChanged: {

View file

@ -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

View file

@ -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;

View file

@ -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
}
}
}

View file

@ -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
}
}

View file

@ -44,7 +44,6 @@
<file>StartPage.qml</file>
<file>RecoverCache.qml</file>
<file>SsrfCheckBox.qml</file>
<file>SsrfSwitch.qml</file>
<file>SsrfTextField.qml</file>