From 5f40ac6da3b7550aacc3b80a594ffc18c03f9efa Mon Sep 17 00:00:00 2001 From: Sebastian Kügler Date: Mon, 30 Nov 2015 01:48:10 +0100 Subject: Style the checkbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using a normal checkbox, we get black text, not our styled Label. Since, short of doing a style, this is the only way to get the label the right color, and thus not screw up the visual appearance of the drawer, we hand-roll it. This is a bit clunky, but I prefer visual continuity here over code complexity concerns. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/main.qml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'qt-mobile/qml/main.qml') diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index cf0e1078e..1888a77e8 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -106,11 +106,33 @@ MobileComponents.ApplicationWindow { } } ] - CheckBox { - text: "Run location service" - checked: manager.locationServiceEnabled - onCheckedChanged: { - manager.locationServiceEnabled = checked; + MouseArea { + height: childrenRect.height + width: MobileComponents.Units.gridUnit * 10 + CheckBox { + //text: "Run location service" + id: locationCheckbox + anchors { + left: parent.left + top: parent.top + } + checked: manager.locationServiceEnabled + onCheckedChanged: { + manager.locationServiceEnabled = checked; + } + } + MobileComponents.Label { + x: MobileComponents.Units.gridUnit * 1.5 + anchors { + left: locationCheckbox.right + //leftMargin: units.smallSpacing + verticalCenter: locationCheckbox.verticalCenter + } + text: "Run location service" + } + onClicked: { + print("Click.") + locationCheckbox.checked = !locationCheckbox.checked } } } -- cgit v1.2.3-70-g09d2