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 { ...@@ -20,8 +20,8 @@ Rectangle {
height: Math.round(ScreenTools.defaultFontPixelHeight * 2) height: Math.round(ScreenTools.defaultFontPixelHeight * 2)
width: ScreenTools.defaultFontPixelWidth * 10 width: ScreenTools.defaultFontPixelWidth * 10
color: qgcPal.button color: qgcPal.button
border.color: qgcPal.text border.color: qgcPal.windowShade
border.width: 1 border.width: 0
property bool checked: true property bool checked: true
...@@ -32,24 +32,23 @@ Rectangle { ...@@ -32,24 +32,23 @@ Rectangle {
Rectangle { Rectangle {
width: parent.width * 0.5 width: parent.width * 0.5
height: parent.height height: parent.height
color: qgcPal.windowShade color: checked ? qgcPal.button : qgcPal.buttonHighlight
visible: !checked
border.color: qgcPal.text border.color: qgcPal.text
border.width: 1 border.width: 0
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
QGCLabel { QGCLabel {
text: qsTr("Off") text: qsTr("Off")
anchors.centerIn: parent anchors.centerIn: parent
color: qgcPal.text
} }
} }
Rectangle { Rectangle {
width: parent.width * 0.5 width: parent.width * 0.5
height: parent.height * 0.95 height: parent.height * 0.95
color: qgcPal.buttonHighlight color: checked ? qgcPal.buttonHighlight : qgcPal.button
visible: checked
border.color: qgcPal.text border.color: qgcPal.text
border.width: 1 border.width: 0
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
QGCLabel { 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