ToggleLabelButton.qml Example File
locationdiagnostics/assets/ToggleLabelButton.qml
import bb.cascades 1.0
Container {
id: root
property alias text: label.text
property bool checked
signal checkedChanged(bool checked)
layout: DockLayout {}
Label {
id: label
horizontalAlignment: HorizontalAlignment.Left
verticalAlignment: VerticalAlignment.Center
textStyle {
base: SystemDefaults.TextStyles.BodyText
}
}
ToggleButton {
horizontalAlignment: HorizontalAlignment.Right
verticalAlignment: VerticalAlignment.Center
checked: root.checked
onCheckedChanged: {
root.checkedChanged(checked);
}
}
}