Merge lp:~unity-team/unity8/greeter-rotation into lp:unity8

Proposed by Michael Terry
Status: Work in progress
Proposed branch: lp:~unity-team/unity8/greeter-rotation
Merge into: lp:unity8
Diff against target: 155 lines (+25/-17)
6 files modified
qml/Greeter/CoverPage.qml (+2/-9)
qml/Greeter/Greeter.qml (+7/-1)
qml/Greeter/NarrowView.qml (+11/-1)
qml/Greeter/WideView.qml (+1/-0)
qml/Rotation/RotationStates.qml (+1/-2)
qml/Shell.qml (+3/-4)
To merge this branch: bzr merge lp:~unity-team/unity8/greeter-rotation
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+291177@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

2326. By Michael Terry

First pass at rotating greeter; in progress, does not look nice yet

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Greeter/CoverPage.qml'
2--- qml/Greeter/CoverPage.qml 2016-02-02 22:07:04 +0000
3+++ qml/Greeter/CoverPage.qml 2016-04-06 20:32:14 +0000
4@@ -30,11 +30,11 @@
5 property bool draggable: true
6
7 property alias infographics: infographics
8+ property alias swipeHint: swipeHint
9
10 readonly property real showProgress: MathUtils.clamp((width - Math.abs(x)) / width, 0, 1)
11
12 signal tease()
13- signal clicked()
14
15 function hideRight() {
16 d.forceRightOnNextHideAnimation = true;
17@@ -56,16 +56,9 @@
18 // instead, we can get a little extra horizontal push by using transforms.
19 transform: Translate { id: translation; x: root.draggable ? launcherOffset : 0 }
20
21- // Eat events elsewhere on the coverpage, except mouse clicks which we pass
22- // up (they are used in the NarrowView to hide the cover page)
23+ // Eat events elsewhere on the coverpage
24 MouseArea {
25 anchors.fill: parent
26- onClicked: root.clicked()
27-
28- MultiPointTouchArea {
29- anchors.fill: parent
30- mouseEnabled: false
31- }
32 }
33
34 Rectangle {
35
36=== modified file 'qml/Greeter/Greeter.qml'
37--- qml/Greeter/Greeter.qml 2016-03-30 07:46:17 +0000
38+++ qml/Greeter/Greeter.qml 2016-04-06 20:32:14 +0000
39@@ -28,8 +28,8 @@
40 created: loader.status == Loader.Ready
41
42 property real dragHandleLeftMargin: 0
43-
44 property url background
45+ property bool hasMouse
46
47 // How far to offset the top greeter layer during a launcher left-drag
48 property real launcherOffset
49@@ -334,6 +334,12 @@
50
51 Binding {
52 target: loader.item
53+ property: "hasMouse"
54+ value: root.hasMouse
55+ }
56+
57+ Binding {
58+ target: loader.item
59 property: "locked"
60 value: root.locked
61 }
62
63=== modified file 'qml/Greeter/NarrowView.qml'
64--- qml/Greeter/NarrowView.qml 2016-03-10 22:42:45 +0000
65+++ qml/Greeter/NarrowView.qml 2016-04-06 20:32:14 +0000
66@@ -27,6 +27,7 @@
67 property alias delayMinutes: lockscreen.delayMinutes
68 property alias backgroundTopMargin: coverPage.backgroundTopMargin
69 property url background
70+ property bool hasMouse
71 property bool locked
72 property bool alphanumeric
73 property var userModel // unused
74@@ -157,7 +158,7 @@
75 width: parent.width
76 background: root.background
77 onTease: root.tease()
78- onClicked: hide()
79+ swipeHint.visible: !loginButton.visible
80
81 onShowProgressChanged: {
82 if (showProgress === 1) {
83@@ -180,5 +181,14 @@
84 horizontalCenter: parent.horizontalCenter
85 }
86 }
87+
88+ Button {
89+ id: loginButton
90+ visible: !root.locked && root.hasMouse
91+ anchors.bottom: coverPage.swipeHint.bottom
92+ anchors.horizontalCenter: coverPage.swipeHint.horizontalCenter
93+ text: i18n.tr("Login")
94+ onClicked: root.responded("")
95+ }
96 }
97 }
98
99=== modified file 'qml/Greeter/WideView.qml'
100--- qml/Greeter/WideView.qml 2016-02-10 18:23:26 +0000
101+++ qml/Greeter/WideView.qml 2016-04-06 20:32:14 +0000
102@@ -26,6 +26,7 @@
103 property int delayMinutes // TODO
104 property alias backgroundTopMargin: coverPage.backgroundTopMargin
105 property alias background: coverPage.background
106+ property bool hasMouse
107 property bool locked
108 property alias alphanumeric: loginList.alphanumeric
109 property alias userModel: loginList.model
110
111=== modified file 'qml/Rotation/RotationStates.qml'
112--- qml/Rotation/RotationStates.qml 2015-10-26 09:59:50 +0000
113+++ qml/Rotation/RotationStates.qml 2016-04-06 20:32:14 +0000
114@@ -126,8 +126,7 @@
115 // There's no point in animating if the user can't see it (display is off).
116 d.animationType = d.noAnimation;
117 } else if (root.shell.showingGreeter) {
118- // A rotating greeter looks weird.
119- d.animationType = d.noAnimation;
120+ d.animationType = d.fullAnimation;
121 } else {
122 if (!root.shell.mainApp) {
123 // shouldn't happen but, anyway
124
125=== modified file 'qml/Shell.qml'
126--- qml/Shell.qml 2016-03-23 09:53:03 +0000
127+++ qml/Shell.qml 2016-04-06 20:32:14 +0000
128@@ -74,7 +74,7 @@
129 && (applicationsDisplayLoader.item && applicationsDisplayLoader.item.orientationChangesEnabled)
130 && (!greeter || !greeter.animating)
131
132- readonly property bool showingGreeter: greeter && greeter.shown
133+ readonly property bool showingGreeter: greeter && greeter.active
134
135 property bool startingUp: true
136 Timer { id: finishStartUpTimer; interval: 500; onTriggered: startingUp = false }
137@@ -83,9 +83,7 @@
138 if (startingUp) {
139 // Ensure we don't rotate during start up
140 return Qt.PrimaryOrientation;
141- } else if (greeter && greeter.shown) {
142- return Qt.PrimaryOrientation;
143- } else if (applicationsDisplayLoader.item) {
144+ } else if (!showingGreeter && applicationsDisplayLoader.item) {
145 return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
146 } else {
147 // we just don't care
148@@ -402,6 +400,7 @@
149 launcherOffset: launcher.progress
150 forcedUnlock: wizard.active
151 background: wallpaperResolver.background
152+ hasMouse: shell.hasMouse
153
154 // avoid overlapping with Launcher's edge drag area
155 // FIXME: Fix TouchRegistry & friends and remove this workaround

Subscribers

People subscribed via source and target branches