| 1 |
import QtQuick 2.4 |
| 2 |
import QtQuick.Controls.Suru 2.2 |
| 3 |
import Lomiri.Components 1.3 |
| 4 |
|
| 5 |
|
| 6 |
AbstractButton { |
| 7 |
objectName: "labeledSwitch" |
| 8 |
height: units.gu(5) |
| 9 |
width: parent.width |
| 10 |
property alias checked: s.checked |
| 11 |
property alias text: label.text |
| 12 |
property alias label: label |
| 13 |
Label { |
| 14 |
id: label |
| 15 |
anchors { |
| 16 |
left: parent.left |
| 17 |
verticalCenter: parent.verticalCenter |
| 18 |
} |
| 19 |
color: Suru.secondaryForegroundColor |
| 20 |
} |
| 21 |
Switch { |
| 22 |
id: s |
| 23 |
anchors { |
| 24 |
right: parent.right |
| 25 |
verticalCenter: parent.verticalCenter |
| 26 |
} |
| 27 |
} |
| 28 |
onClicked: s.checked = !s.checked |
| 29 |
} |