on xenial help sign in
line up the visuals, no checkboxes
a8442ccLukáš Tinkl
qml/Wizard/Pages/50-location.qml+125−53
@@ -15,6 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.3
17import QtQuick 2.3
18+import QtQuick.Controls 1.3
18import AccountsService 0.1
19import AccountsService 0.1
19import QMenuModel 0.1 as QMenuModel
20import QMenuModel 0.1 as QMenuModel
20import Qt.labs.folderlistmodel 2.1
21import Qt.labs.folderlistmodel 2.1
@@ -50,81 +51,152 @@ LocalComponents.Page {
50 Component.onCompleted: start()
51 Component.onCompleted: start()
51 }
52 }
52
53
53− Column {
54+ Component.onCompleted: {
55+ group.bindCheckable(hereCheckLabel)
56+ group.bindCheckable(gpsCheckLabel)
57+ group.bindCheckable(nopeCheckLabel)
58+ }
59+
60+ ExclusiveGroup {
61+ id: group
62+ }
63+
64+ Item {
54 id: column
65 id: column
55 anchors.fill: content
66 anchors.fill: content
56− spacing: units.gu(4)
57 anchors.topMargin: units.gu(4)
67 anchors.topMargin: units.gu(4)
58
68
59− Column {
69+ Label {
60− anchors.left: parent.left
70+ id: hereCheckLabel
61− anchors.right: parent.right
71+ anchors {
62− height: childrenRect.height
72+ left: parent.left
63− spacing: units.gu(2)
73+ right: parent.right
64−
74+ top: parent.top
65− LocalComponents.CheckableSetting {
75+ rightMargin: rightMargin
66− id: hereCheck
76+ }
67− objectName: "hereCheck"
77+
68− showDivider: false
78+ wrapMode: Text.WordWrap
79+ color: "black"
80+ font.weight: checked ? Font.Normal : Font.Light
69− text: i18n.tr("Use GPS, Wi-Fi hotspots and mobile network anonymously to detect location (recommended)")
81+ text: i18n.tr("Use GPS, Wi-Fi hotspots and mobile network anonymously to detect location (recommended)")
70− checked: true
82+ property bool checked: true
71− onTriggered: {
83+
72− gpsCheck.checked = false;
84+ MouseArea {
73− hereCheck.checked = true;
85+ anchors.fill: parent
74− nopeCheck.checked = false;
86+ onClicked: {
87+ hereCheckLabel.checked = !hereCheckLabel.checked
75 }
88 }
76 }
89 }
90+ }
77
91
78− Label {
92+ Label {
79− id: termsLabel
93+ id: hereTermsLabel
80− objectName: "hereTermsLink"
94+ anchors {
81− anchors.left: parent.left
95+ left: parent.left
82− anchors.leftMargin: hereCheck.labelOffset
83− anchors.right: parent.right
96+ right: parent.right
84− wrapMode: Text.Wrap
97+ top: hereCheckLabel.bottom
85− linkColor: "#dd4814"
98+ topMargin: units.gu(1)
86− color: "black"
99+ rightMargin: rightMargin
87− fontSize: "small"
88− font.weight: Font.Light
89− // TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
90− text: i18n.tr("By selecting this option you agree to the Nokia HERE <a href='#'>terms and conditions</a>.")
91− onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml"))
92 }
100 }
101+
102+ wrapMode: Text.WordWrap
103+ color: "black"
104+ font.weight: Font.Light
105+ fontSize: "small"
106+ linkColor: "#dd4814"
107+ text: i18n.tr("By selecting this option you agree to the Nokia HERE <a href='#'>terms and conditions</a>.")
108+ onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml"))
109+ }
110+
111+ Image {
112+ fillMode: Image.PreserveAspectFit
113+ height: hereCheckLabel.height
114+ source: "data/Tick.png"
115+ opacity: hereCheckLabel.checked ? 1 : 0
116+ anchors.right: parent.right
93 }
117 }
94
118
95− LocalComponents.CheckableSetting {
119+ Label {
96− id: gpsCheck
120+ id: gpsCheckLabel
97− objectName: "gpsCheck"
121+ anchors {
98− showDivider: false
122+ left: parent.left
123+ right: parent.right
124+ top: hereTermsLabel.bottom
125+ topMargin: units.gu(3)
126+ rightMargin: rightMargin
127+ }
99 text: i18n.tr("GPS only")
128 text: i18n.tr("GPS only")
100− onTriggered: {
129+ wrapMode: Text.WordWrap
101− gpsCheck.checked = true;
130+ color: "black"
102− hereCheck.checked = false;
131+ font.weight: checked ? Font.Normal : Font.Light
103− nopeCheck.checked = false;
132+ width: content.width
133+ property bool checked: false
134+
135+ MouseArea {
136+ anchors.fill: parent
137+ onClicked: {
138+ gpsCheckLabel.checked = !gpsCheckLabel.checked
139+ }
104 }
140 }
105 }
141 }
106
142
107− LocalComponents.CheckableSetting {
143+ Image {
108− id: nopeCheck
144+ fillMode: Image.PreserveAspectFit
109− objectName: "nopeCheck"
145+ height: gpsCheckLabel.height
110− showDivider: false
146+ source: "data/Tick.png"
147+ opacity: gpsCheckLabel.checked ? 1 : 0
148+ anchors.right: parent.right
149+ anchors.verticalCenter: gpsCheckLabel.verticalCenter
150+ }
151+
152+ Label {
153+ id: nopeCheckLabel
154+ anchors {
155+ left: parent.left
156+ right: parent.right
157+ top: gpsCheckLabel.bottom
158+ topMargin: units.gu(3)
159+ rightMargin: rightMargin
160+ }
161+ wrapMode: Text.WordWrap
162+ color: "black"
163+ font.weight: checked ? Font.Normal : Font.Light
164+ width: content.width
111 text: i18n.tr("Don't use my location")
165 text: i18n.tr("Don't use my location")
112− onTriggered: {
166+ property bool checked: false
113− gpsCheck.checked = false;
167+
114− hereCheck.checked = false;
168+ MouseArea {
115− nopeCheck.checked = true;
169+ anchors.fill: parent
170+ onClicked: {
171+ nopeCheckLabel.checked = !nopeCheckLabel.checked
172+ }
116 }
173 }
117 }
174 }
118
175
119− Label {
176+ Image {
120− anchors.left: parent.left
177+ fillMode: Image.PreserveAspectFit
178+ height: nopeCheckLabel.height
179+ source: "data/Tick.png"
180+ opacity: nopeCheckLabel.checked ? 1 : 0
121 anchors.right: parent.right
181 anchors.right: parent.right
182+ anchors.verticalCenter: nopeCheckLabel.verticalCenter
183+ }
184+
185+ Label {
186+ id: infoLabel
187+ anchors {
188+ left: parent.left
189+ right: parent.right
190+ top: nopeCheckLabel.bottom
191+ topMargin: units.gu(3)
192+ }
122 wrapMode: Text.Wrap
193 wrapMode: Text.Wrap
123 textFormat: Text.RichText
194 textFormat: Text.RichText
124 text: i18n.tr("You can change it later in <em>System Settings</em>.")
195 text: i18n.tr("You can change it later in <em>System Settings</em>.")
125 color: "black"
196 color: "black"
126 fontSize: "small"
197 fontSize: "small"
127 font.weight: Font.Light
198 font.weight: Font.Light
199+ width: content.width
128 }
200 }
129 }
201 }
130
202
@@ -133,9 +205,9 @@ LocalComponents.Page {
133 LocalComponents.StackButton {
205 LocalComponents.StackButton {
134 text: i18n.tr("Next")
206 text: i18n.tr("Next")
135 onClicked: {
207 onClicked: {
136− var locationOn = gpsCheck.checked || hereCheck.checked;
208+ var locationOn = gpsCheckLabel.checked || hereCheckLabel.checked;
137− var gpsOn = gpsCheck.checked || hereCheck.checked;
209+ var gpsOn = gpsCheckLabel.checked || hereCheckLabel.checked;
138− var hereOn = hereCheck.checked;
210+ var hereOn = hereCheckLabel.checked;
139
211
140 // location service doesn't currently listen to updateState
212 // location service doesn't currently listen to updateState
141 // requests, so we activate the actions if needed.
213 // requests, so we activate the actions if needed.