Commit 052c5c91 authored by Yasen's avatar Yasen

Update CustomOnOffSwitch.qml

Custon On / Off  switch updated to show label when off. Now works more like a toggle
parent ca189553
......@@ -20,8 +20,8 @@ Rectangle {
height: Math.round(ScreenTools.defaultFontPixelHeight * 2)
width: ScreenTools.defaultFontPixelWidth * 10
color: qgcPal.button
border.color: qgcPal.text
border.width: 1
border.color: qgcPal.windowShade
border.width: 0
property bool checked: true
......@@ -32,24 +32,23 @@ Rectangle {
Rectangle {
width: parent.width * 0.5
height: parent.height
color: qgcPal.windowShade
visible: !checked
color: checked ? qgcPal.button : qgcPal.buttonHighlight
border.color: qgcPal.text
border.width: 1
border.width: 0
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
QGCLabel {
text: qsTr("Off")
anchors.centerIn: parent
color: qgcPal.text
}
}
Rectangle {
width: parent.width * 0.5
height: parent.height * 0.95
color: qgcPal.buttonHighlight
visible: checked
color: checked ? qgcPal.buttonHighlight : qgcPal.button
border.color: qgcPal.text
border.width: 1
border.width: 0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
QGCLabel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment