on xenial help sign in
refactor desktopLook -> wideMode
28af86eLukáš Tinkl
qml/Wizard/Page.qml+3−3
@@ -20,7 +20,7 @@ import Wizard 0.1
20
20
21Item {
21Item {
22 readonly property real maximumContentWidth: units.gu(50)
22 readonly property real maximumContentWidth: units.gu(50)
23− readonly property bool desktopLook: width > units.gu(90) && width > height
23+ readonly property bool wideMode: width > units.gu(90) && width > height
24 readonly property bool contentAnimationRunning: contentAnimation.running
24 readonly property bool contentAnimationRunning: contentAnimation.running
25
25
26 readonly property real buttonMargin: units.gu(3)
26 readonly property real buttonMargin: units.gu(3)
@@ -33,7 +33,7 @@ Item {
33 readonly property real bottomMargin: units.gu(3)
33 readonly property real bottomMargin: units.gu(3)
34 readonly property real leftMargin: Math.max(units.gu(3), (width - maximumContentWidth) / 3)
34 readonly property real leftMargin: Math.max(units.gu(3), (width - maximumContentWidth) / 3)
35 readonly property real rightMargin: leftMargin
35 readonly property real rightMargin: leftMargin
36− readonly property real customMargin: desktopLook ? units.gu(8) : units.gu(4) // margin for the content
36+ readonly property real customMargin: wideMode ? units.gu(8) : units.gu(4) // margin for the content
37 readonly property real staticMargin: units.gu(3)
37 readonly property real staticMargin: units.gu(3)
38
38
39 // colors
39 // colors
@@ -86,7 +86,7 @@ Item {
86 left: parent.left
86 left: parent.left
87 right: parent.right
87 right: parent.right
88 }
88 }
89− source: customTitle ? "" : (desktopLook ? "Pages/data/Desktop_header_bkg.png" : "Pages/data/Phone_header_bkg.png")
89+ source: customTitle ? "" : (wideMode ? "Pages/data/Desktop_header_bkg.png" : "Pages/data/Phone_header_bkg.png")
90 height: titleRectHeight
90 height: titleRectHeight
91 clip: true
91 clip: true
92
92
qml/Wizard/Pages/10-welcome.qml+4−4
@@ -64,7 +64,7 @@ LocalComponents.Page {
64 anchors.left: parent.left
64 anchors.left: parent.left
65 anchors.right: parent.right
65 anchors.right: parent.right
66 height: parent.height
66 height: parent.height
67− source: desktopLook ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
67+ source: wideMode ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
68 fillMode: Image.PreserveAspectCrop
68 fillMode: Image.PreserveAspectCrop
69 z: 2
69 z: 2
70 visible: opacity > 0
70 visible: opacity > 0
@@ -96,9 +96,9 @@ LocalComponents.Page {
96
96
97 anchors {
97 anchors {
98 fill: content
98 fill: content
99− leftMargin: desktopLook ? parent.leftMargin : 0
99+ leftMargin: wideMode ? parent.leftMargin : 0
100− rightMargin: desktopLook ? parent.rightMargin : 0
100+ rightMargin: wideMode ? parent.rightMargin : 0
101− topMargin: desktopLook ? parent.customMargin : 0
101+ topMargin: wideMode ? parent.customMargin : 0
102 }
102 }
103
103
104 model: plugin.languageNames
104 model: plugin.languageNames
qml/Wizard/Pages/30-wifi.qml+2−2
@@ -148,8 +148,8 @@ LocalComponents.Page {
148 anchors {
148 anchors {
149 fill: content
149 fill: content
150 topMargin: customMargin
150 topMargin: customMargin
151− leftMargin: desktopLook ? parent.leftMargin : 0
151+ leftMargin: wideMode ? parent.leftMargin : 0
152− rightMargin: desktopLook ? parent.rightMargin : 0
152+ rightMargin: wideMode ? parent.rightMargin : 0
153 }
153 }
154
154
155 Label {
155 Label {
qml/Wizard/Pages/40-location.qml+2−2
@@ -54,8 +54,8 @@ LocalComponents.Page {
54 id: column
54 id: column
55 anchors.fill: content
55 anchors.fill: content
56 anchors.topMargin: customMargin
56 anchors.topMargin: customMargin
57− anchors.leftMargin: desktopLook ? parent.leftMargin : 0
57+ anchors.leftMargin: wideMode ? parent.leftMargin : 0
58− anchors.rightMargin: desktopLook ? parent.rightMargin : 0
58+ anchors.rightMargin: wideMode ? parent.rightMargin : 0
59
59
60 Item {
60 Item {
61 id: hereCheckGroup
61 id: hereCheckGroup
qml/Wizard/Pages/50-timezone.qml+7−7
@@ -30,7 +30,7 @@ LocalComponents.Page {
30 forwardButtonSourceComponent: forwardButton
30 forwardButtonSourceComponent: forwardButton
31
31
32 property string selectedTimeZone: ""
32 property string selectedTimeZone: ""
33− readonly property bool showingMap: desktopLook && width >= units.gu(110)
33+ readonly property bool showingMap: wideMode && width >= units.gu(110)
34
34
35 // for testing
35 // for testing
36 readonly property alias tdModule: timeDatePanel
36 readonly property alias tdModule: timeDatePanel
@@ -104,7 +104,7 @@ LocalComponents.Page {
104 Column {
104 Column {
105 anchors.verticalCenter: parent.verticalCenter
105 anchors.verticalCenter: parent.verticalCenter
106 anchors.left: parent.left
106 anchors.left: parent.left
107− anchors.leftMargin: !desktopLook ? staticMargin : 0
107+ anchors.leftMargin: !wideMode ? staticMargin : 0
108 anchors.right: image.left
108 anchors.right: image.left
109 anchors.rightMargin: units.gu(2)
109 anchors.rightMargin: units.gu(2)
110
110
@@ -131,7 +131,7 @@ LocalComponents.Page {
131 anchors {
131 anchors {
132 right: parent.right
132 right: parent.right
133 verticalCenter: parent.verticalCenter
133 verticalCenter: parent.verticalCenter
134− rightMargin: !desktopLook ? staticMargin : 0
134+ rightMargin: !wideMode ? staticMargin : 0
135 }
135 }
136 fillMode: Image.PreserveAspectFit
136 fillMode: Image.PreserveAspectFit
137 height: units.gu(1.5)
137 height: units.gu(1.5)
@@ -161,8 +161,8 @@ LocalComponents.Page {
161 top: content.top
161 top: content.top
162 bottom: content.bottom
162 bottom: content.bottom
163 right: !showingMap ? content.right : undefined
163 right: !showingMap ? content.right : undefined
164− leftMargin: showingMap ? staticMargin : (desktopLook ? tzPage.leftMargin : 0)
164+ leftMargin: showingMap ? staticMargin : (wideMode ? tzPage.leftMargin : 0)
165− rightMargin: showingMap ? staticMargin : (desktopLook ? tzPage.rightMargin : 0)
165+ rightMargin: showingMap ? staticMargin : (wideMode ? tzPage.rightMargin : 0)
166 topMargin: customMargin
166 topMargin: customMargin
167 }
167 }
168
168
@@ -173,8 +173,8 @@ LocalComponents.Page {
173 objectName: "tzFilter"
173 objectName: "tzFilter"
174 anchors.left: parent.left
174 anchors.left: parent.left
175 anchors.right: parent.right
175 anchors.right: parent.right
176− anchors.leftMargin: !showingMap && !desktopLook ? staticMargin : undefined
176+ anchors.leftMargin: !showingMap && !wideMode ? staticMargin : undefined
177− anchors.rightMargin: !showingMap && !desktopLook ? staticMargin : undefined
177+ anchors.rightMargin: !showingMap && !wideMode ? staticMargin : undefined
178 placeholderText: i18n.tr("Enter your city")
178 placeholderText: i18n.tr("Enter your city")
179 inputMethodHints: Qt.ImhNoPredictiveText
179 inputMethodHints: Qt.ImhNoPredictiveText
180 onTextChanged: resetViews();
180 onTextChanged: resetViews();
qml/Wizard/Pages/70-passwd-type.qml+3−3
@@ -64,8 +64,8 @@ LocalComponents.Page {
64 id: column
64 id: column
65 anchors.fill: content
65 anchors.fill: content
66 anchors.topMargin: customMargin
66 anchors.topMargin: customMargin
67− anchors.leftMargin: desktopLook ? parent.leftMargin : 0
67+ anchors.leftMargin: wideMode ? parent.leftMargin : 0
68− anchors.rightMargin: desktopLook ? parent.rightMargin : 0
68+ anchors.rightMargin: wideMode ? parent.rightMargin : 0
69
69
70 ListView {
70 ListView {
71 id: selector
71 id: selector
@@ -152,7 +152,7 @@ LocalComponents.Page {
152 else
152 else
153 pageStack.next(); // got the password already, go next page
153 pageStack.next(); // got the password already, go next page
154 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) { // passcode
154 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) { // passcode
155− if (desktopLook) {
155+ if (wideMode) {
156 pageStack.load(Qt.resolvedUrl("passcode-desktop.qml"));
156 pageStack.load(Qt.resolvedUrl("passcode-desktop.qml"));
157 } else {
157 } else {
158 pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
158 pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
qml/Wizard/Pages/80-finished.qml+1−1
@@ -59,7 +59,7 @@ LocalComponents.Page {
59
59
60 Image {
60 Image {
61 id: bgImage
61 id: bgImage
62− source: desktopLook ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
62+ source: wideMode ? "data/Desktop_splash_screen_bkg.png" : "data/Phone_splash_screen_bkg.png"
63 scale: Image.PreserveAspectFit
63 scale: Image.PreserveAspectFit
64 anchors.left: parent.left
64 anchors.left: parent.left
65 anchors.right: parent.right
65 anchors.right: parent.right
qml/Wizard/Pages/here-terms.qml+1−1
@@ -54,7 +54,7 @@ LocalComponents.Page {
54 id: column
54 id: column
55 anchors.fill: content
55 anchors.fill: content
56 anchors.leftMargin: staticMargin
56 anchors.leftMargin: staticMargin
57− anchors.rightMargin: desktopLook ? parent.rightMargin : staticMargin
57+ anchors.rightMargin: wideMode ? parent.rightMargin : staticMargin
58 spacing: units.gu(3)
58 spacing: units.gu(3)
59
59
60 Label {
60 Label {