on xenial help sign in
refactor desktopLook -> wideMode
commit28af86e8309f09ff7cd90c888f33facbf8576d3d authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 11 Mar 2016, 14:50 (11 years ago) parent13c4946
8 files changed+23−23
qml/Wizard/Page.qml+3−3 qml/Wizard/Pages/10-welcome.qml+4−4 qml/Wizard/Pages/30-wifi.qml+2−2 qml/Wizard/Pages/40-location.qml+2−2 qml/Wizard/Pages/50-timezone.qml+7−7 qml/Wizard/Pages/70-passwd-type.qml+3−3 qml/Wizard/Pages/80-finished.qml+1−1 qml/Wizard/Pages/here-terms.qml+1−1
qml/Wizard/Page.qml+3−3
@@ -20,7 +20,7 @@ import Wizard 0.1
2020
2121Item {
2222 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
2424 readonly property bool contentAnimationRunning: contentAnimation.running
2525
2626 readonly property real buttonMargin: units.gu(3)
@@ -33,7 +33,7 @@ Item {
3333 readonly property real bottomMargin: units.gu(3)
3434 readonly property real leftMargin: Math.max(units.gu(3), (width - maximumContentWidth) / 3)
3535 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
3737 readonly property real staticMargin: units.gu(3)
3838
3939 // colors
@@ -86,7 +86,7 @@ Item {
8686 left: parent.left
8787 right: parent.right
8888 }
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")
9090 height: titleRectHeight
9191 clip: true
9292
qml/Wizard/Pages/10-welcome.qml+4−4
@@ -64,7 +64,7 @@ LocalComponents.Page {
6464 anchors.left: parent.left
6565 anchors.right: parent.right
6666 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"
6868 fillMode: Image.PreserveAspectCrop
6969 z: 2
7070 visible: opacity > 0
@@ -96,9 +96,9 @@ LocalComponents.Page {
9696
9797 anchors {
9898 fill: content
99− leftMargin: desktopLook ? parent.leftMargin : 0
100− rightMargin: desktopLook ? parent.rightMargin : 0
101− topMargin: desktopLook ? parent.customMargin : 0
99+ leftMargin: wideMode ? parent.leftMargin : 0
100+ rightMargin: wideMode ? parent.rightMargin : 0
101+ topMargin: wideMode ? parent.customMargin : 0
102102 }
103103
104104 model: plugin.languageNames
qml/Wizard/Pages/30-wifi.qml+2−2
@@ -148,8 +148,8 @@ LocalComponents.Page {
148148 anchors {
149149 fill: content
150150 topMargin: customMargin
151− leftMargin: desktopLook ? parent.leftMargin : 0
152− rightMargin: desktopLook ? parent.rightMargin : 0
151+ leftMargin: wideMode ? parent.leftMargin : 0
152+ rightMargin: wideMode ? parent.rightMargin : 0
153153 }
154154
155155 Label {
qml/Wizard/Pages/40-location.qml+2−2
@@ -54,8 +54,8 @@ LocalComponents.Page {
5454 id: column
5555 anchors.fill: content
5656 anchors.topMargin: customMargin
57− anchors.leftMargin: desktopLook ? parent.leftMargin : 0
58− anchors.rightMargin: desktopLook ? parent.rightMargin : 0
57+ anchors.leftMargin: wideMode ? parent.leftMargin : 0
58+ anchors.rightMargin: wideMode ? parent.rightMargin : 0
5959
6060 Item {
6161 id: hereCheckGroup
qml/Wizard/Pages/50-timezone.qml+7−7
@@ -30,7 +30,7 @@ LocalComponents.Page {
3030 forwardButtonSourceComponent: forwardButton
3131
3232 property string selectedTimeZone: ""
33− readonly property bool showingMap: desktopLook && width >= units.gu(110)
33+ readonly property bool showingMap: wideMode && width >= units.gu(110)
3434
3535 // for testing
3636 readonly property alias tdModule: timeDatePanel
@@ -104,7 +104,7 @@ LocalComponents.Page {
104104 Column {
105105 anchors.verticalCenter: parent.verticalCenter
106106 anchors.left: parent.left
107− anchors.leftMargin: !desktopLook ? staticMargin : 0
107+ anchors.leftMargin: !wideMode ? staticMargin : 0
108108 anchors.right: image.left
109109 anchors.rightMargin: units.gu(2)
110110
@@ -131,7 +131,7 @@ LocalComponents.Page {
131131 anchors {
132132 right: parent.right
133133 verticalCenter: parent.verticalCenter
134− rightMargin: !desktopLook ? staticMargin : 0
134+ rightMargin: !wideMode ? staticMargin : 0
135135 }
136136 fillMode: Image.PreserveAspectFit
137137 height: units.gu(1.5)
@@ -161,8 +161,8 @@ LocalComponents.Page {
161161 top: content.top
162162 bottom: content.bottom
163163 right: !showingMap ? content.right : undefined
164− leftMargin: showingMap ? staticMargin : (desktopLook ? tzPage.leftMargin : 0)
165− rightMargin: showingMap ? staticMargin : (desktopLook ? tzPage.rightMargin : 0)
164+ leftMargin: showingMap ? staticMargin : (wideMode ? tzPage.leftMargin : 0)
165+ rightMargin: showingMap ? staticMargin : (wideMode ? tzPage.rightMargin : 0)
166166 topMargin: customMargin
167167 }
168168
@@ -173,8 +173,8 @@ LocalComponents.Page {
173173 objectName: "tzFilter"
174174 anchors.left: parent.left
175175 anchors.right: parent.right
176− anchors.leftMargin: !showingMap && !desktopLook ? staticMargin : undefined
177− anchors.rightMargin: !showingMap && !desktopLook ? staticMargin : undefined
176+ anchors.leftMargin: !showingMap && !wideMode ? staticMargin : undefined
177+ anchors.rightMargin: !showingMap && !wideMode ? staticMargin : undefined
178178 placeholderText: i18n.tr("Enter your city")
179179 inputMethodHints: Qt.ImhNoPredictiveText
180180 onTextChanged: resetViews();
qml/Wizard/Pages/70-passwd-type.qml+3−3
@@ -64,8 +64,8 @@ LocalComponents.Page {
6464 id: column
6565 anchors.fill: content
6666 anchors.topMargin: customMargin
67− anchors.leftMargin: desktopLook ? parent.leftMargin : 0
68− anchors.rightMargin: desktopLook ? parent.rightMargin : 0
67+ anchors.leftMargin: wideMode ? parent.leftMargin : 0
68+ anchors.rightMargin: wideMode ? parent.rightMargin : 0
6969
7070 ListView {
7171 id: selector
@@ -152,7 +152,7 @@ LocalComponents.Page {
152152 else
153153 pageStack.next(); // got the password already, go next page
154154 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) { // passcode
155− if (desktopLook) {
155+ if (wideMode) {
156156 pageStack.load(Qt.resolvedUrl("passcode-desktop.qml"));
157157 } else {
158158 pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
qml/Wizard/Pages/80-finished.qml+1−1
@@ -59,7 +59,7 @@ LocalComponents.Page {
5959
6060 Image {
6161 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"
6363 scale: Image.PreserveAspectFit
6464 anchors.left: parent.left
6565 anchors.right: parent.right
qml/Wizard/Pages/here-terms.qml+1−1
@@ -54,7 +54,7 @@ LocalComponents.Page {
5454 id: column
5555 anchors.fill: content
5656 anchors.leftMargin: staticMargin
57− anchors.rightMargin: desktopLook ? parent.rightMargin : staticMargin
57+ anchors.rightMargin: wideMode ? parent.rightMargin : staticMargin
5858 spacing: units.gu(3)
5959
6060 Label {