mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: replace all checkboxes with our own
As per title, helps simplify theme modifications. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
parent
fe425924e4
commit
ae33422ede
2 changed files with 2 additions and 41 deletions
|
@ -114,32 +114,13 @@ Item {
|
||||||
text: qsTr("Use current\nGPS location:")
|
text: qsTr("Use current\nGPS location:")
|
||||||
visible: manager.locationServiceAvailable
|
visible: manager.locationServiceAvailable
|
||||||
}
|
}
|
||||||
CheckBox {
|
SsrfCheckBox {
|
||||||
id: checkboxGPS
|
id: checkboxGPS
|
||||||
visible: manager.locationServiceAvailable
|
visible: manager.locationServiceAvailable
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
if (checked)
|
if (checked)
|
||||||
gpsText = manager.getCurrentPosition()
|
gpsText = manager.getCurrentPosition()
|
||||||
}
|
}
|
||||||
indicator: Rectangle {
|
|
||||||
implicitWidth: 20
|
|
||||||
implicitHeight: 20
|
|
||||||
x: checkboxGPS.leftPadding
|
|
||||||
y: parent.height / 2 - height / 2
|
|
||||||
radius: 4
|
|
||||||
border.color: checkboxGPS.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
|
|
||||||
color: subsurfaceTheme.backgroundColor
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 12
|
|
||||||
height: 12
|
|
||||||
x: 4
|
|
||||||
y: 4
|
|
||||||
radius: 3
|
|
||||||
color: checkboxGPS.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
|
|
||||||
visible: checkboxGPS.checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Label {
|
Kirigami.Label {
|
||||||
|
|
|
@ -34,32 +34,12 @@ Kirigami.AbstractListItem {
|
||||||
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
|
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
|
||||||
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
|
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
|
||||||
}
|
}
|
||||||
CheckBox {
|
SsrfCheckBox {
|
||||||
id: diveIsSelected
|
id: diveIsSelected
|
||||||
checked: innerListItem.selected;
|
checked: innerListItem.selected;
|
||||||
width: childrenRect.width - Kirigami.Units.smallSpacing;
|
width: childrenRect.width - Kirigami.Units.smallSpacing;
|
||||||
height: childrenRect.heigh - Kirigami.Units.smallSpacing;
|
height: childrenRect.heigh - Kirigami.Units.smallSpacing;
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
indicator: Rectangle {
|
|
||||||
visible: diveIsSelected
|
|
||||||
implicitWidth: 20
|
|
||||||
implicitHeight: 20
|
|
||||||
//x: isBluetooth.leftPadding
|
|
||||||
y: parent.height / 2 - height / 2
|
|
||||||
radius: 4
|
|
||||||
border.color: diveIsSelected.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
|
|
||||||
color: subsurfaceTheme.backgroundColor
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 12
|
|
||||||
height: 12
|
|
||||||
x: 4
|
|
||||||
y: 4
|
|
||||||
radius: 3
|
|
||||||
color: diveIsSelected.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
|
|
||||||
visible: diveIsSelected && diveIsSelected.checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("Clicked on the checkbox of item " + index)
|
console.log("Clicked on the checkbox of item " + index)
|
||||||
importModel.selectRow(index)
|
importModel.selectRow(index)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue