on xenial help sign in
added edge hinting to greeter
commit652fa308e2ed67459586338e42abcfa4c7f26fe6 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 13 Jun 2013, 12:28 (13 years ago) parentfe7ed42
2 files changed+38−3
Greeter/Greeter.qml+35 Greeter/GreeterContent.qml+3−3
Greeter/Greeter.qml+35
@@ -31,10 +31,17 @@ Showable {
3131 readonly property bool multiUser: LightDM.Users.count > 1
3232
3333 readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.leftTeaserPressed
34+ readonly property bool rightTeaserPressed: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.rightTeaserPressed
3435
3536 signal selected(int uid)
3637 signal unlocked(int uid)
3738
39+ onRightTeaserPressedChanged: {
40+ if (rightTeaserPressed) {
41+ teasingTimer.start();
42+ }
43+ }
44+
3845 Loader {
3946 id: greeterContentLoader
4047 objectName: "greeterContentLoader"
@@ -54,4 +61,32 @@ Showable {
5461 onUnlocked: greeter.unlocked(uid);
5562 }
5663 }
64+
65+ Timer {
66+ id: teasingTimer
67+ interval: 200
68+ }
69+
70+ states: [
71+ State {
72+ name: "teasing"
73+ when: greeter.rightTeaserPressed || teasingTimer.running
74+ PropertyChanges {
75+ target: greeter
76+ x: -units.gu(2)
77+ }
78+ }
79+ ]
80+ transitions: [
81+ Transition {
82+ from: "*"
83+ to: "*"
84+ NumberAnimation {
85+ target: greeter
86+ property: "x"
87+ duration: 300
88+ easing.type: Easing.OutCubic
89+ }
90+ }
91+ ]
5792}
Greeter/GreeterContent.qml+3−3
@@ -25,7 +25,8 @@ MouseArea {
2525
2626 property bool promptless: loginLoader.status == Loader.Ready && LightDM.Greeter.promptless
2727 property bool ready: wallpaper.status == Image.Ready
28− property alias leftTeaserPressed: leftTeaser.pressed
28+ property bool leftTeaserPressed: teasingMouseArea.pressed && teasingMouseArea.mouseX < teasingMouseArea.width / 2
29+ property bool rightTeaserPressed: teasingMouseArea.pressed && teasingMouseArea.mouseX > teasingMouseArea.width / 2
2930
3031 signal selected(int uid)
3132 signal unlocked(int uid)
@@ -57,9 +58,8 @@ MouseArea {
5758 }
5859
5960 MouseArea {
60− id: leftTeaser
61+ id: teasingMouseArea
6162 anchors.fill: parent
62− anchors.rightMargin: parent.width / 2
6363 }
6464
6565 Loader {