on xenial help sign in
Merge
commit23a7332d2682e25b4fc065eb6e96c6cfbd56fa4a authorAlbert Astals <albert.astals@canonical.com> dateFri 14 Jun 2013, 10:07 (13 years ago) parent673e1c35640542
6 files changed+138−75
Greeter/Greeter.qml+38−1 Greeter/GreeterContent.qml+5−3 po/es.po+31−31 po/zh_CN.po+32−32 tests/qmltests/Greeter/tst_Phone.qml+13−8 tests/qmltests/Greeter/tst_Tablet.qml+19
Greeter/Greeter.qml+38−1
@@ -30,11 +30,20 @@ Showable {
3030 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
3131 readonly property bool multiUser: LightDM.Users.count > 1
3232
33− readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.leftTeaserPressed
33+ readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready &&
34+ greeterContentLoader.item.leftTeaserPressed
35+ readonly property bool rightTeaserPressed: greeterContentLoader.status == Loader.Ready &&
36+ greeterContentLoader.item.rightTeaserPressed
3437
3538 signal selected(int uid)
3639 signal unlocked(int uid)
3740
41+ onRightTeaserPressedChanged: {
42+ if (rightTeaserPressed) {
43+ teasingTimer.start();
44+ }
45+ }
46+
3847 Loader {
3948 id: greeterContentLoader
4049 objectName: "greeterContentLoader"
@@ -54,4 +63,32 @@ Showable {
5463 onUnlocked: greeter.unlocked(uid);
5564 }
5665 }
66+
67+ Timer {
68+ id: teasingTimer
69+ interval: 200
70+ }
71+
72+ states: [
73+ State {
74+ name: "teasing"
75+ when: greeter.rightTeaserPressed || teasingTimer.running
76+ PropertyChanges {
77+ target: greeter
78+ x: -units.gu(2)
79+ }
80+ }
81+ ]
82+ transitions: [
83+ Transition {
84+ from: "*"
85+ to: "*"
86+ NumberAnimation {
87+ target: greeter
88+ property: "x"
89+ duration: 300
90+ easing.type: Easing.OutCubic
91+ }
92+ }
93+ ]
5794}
Greeter/GreeterContent.qml+5−3
@@ -25,7 +25,10 @@ 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 &&
29+ teasingMouseArea.mouseX < teasingMouseArea.width / 2
30+ property bool rightTeaserPressed: teasingMouseArea.pressed &&
31+ teasingMouseArea.mouseX > teasingMouseArea.width / 2
2932
3033 signal selected(int uid)
3134 signal unlocked(int uid)
@@ -57,9 +60,8 @@ MouseArea {
5760 }
5861
5962 MouseArea {
60− id: leftTeaser
63+ id: teasingMouseArea
6164 anchors.fill: parent
62− anchors.rightMargin: parent.width / 2
6365 }
6466
6567 Loader {
po/es.po+31−31
@@ -8,82 +8,82 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-06-08 14:40+0200\n"
11−"PO-Revision-Date: 2013-06-05 22:20+0000\n"
12−"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11+"PO-Revision-Date: 2013-06-13 23:18+0000\n"
12+"Last-Translator: Adolfo Jayme Barrientos <fitoschido@gmail.com>\n"
1313"Language-Team: Spanish <es@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-06-11 06:34+0000\n"
17+"X-Launchpad-Export-Date: 2013-06-14 07:06+0000\n"
1818"X-Generator: Launchpad (build 16667)\n"
1919
2020#: Applications/applications.js:23
2121msgid "Phone"
22−msgstr ""
22+msgstr "Teléfono"
2323
2424#: Applications/applications.js:29
2525msgid "Camera"
26−msgstr ""
26+msgstr "Cámara"
2727
2828#: Applications/applications.js:35
2929msgid "Gallery"
30−msgstr ""
30+msgstr "Galería"
3131
3232#: Applications/applications.js:40
3333msgid "Facebook"
34−msgstr ""
34+msgstr "Facebook"
3535
3636#: Applications/applications.js:46
3737msgid "Browser"
38−msgstr ""
38+msgstr "Navegador"
3939
4040#: Applications/applications.js:51
4141msgid "Twitter"
42−msgstr ""
42+msgstr "Twitter"
4343
4444#: Applications/applications.js:57
4545msgid "GMail"
46−msgstr ""
46+msgstr "GMail"
4747
4848#: Applications/applications.js:62
4949msgid "Weather"
50−msgstr ""
50+msgstr "Metereología"
5151
5252#: Applications/applications.js:68
5353msgid "Notepad"
54−msgstr ""
54+msgstr "Bloc de notas"
5555
5656#: Applications/applications.js:74
5757msgid "Calendar"
58−msgstr ""
58+msgstr "Calendario"
5959
6060#: Applications/applications.js:80
6161msgid "Media Player"
62−msgstr ""
62+msgstr "Reproductor multimedia"
6363
6464#: Applications/applications.js:86
6565msgid "Evernote"
66−msgstr ""
66+msgstr "Evernote"
6767
6868#: Applications/applications.js:91
6969msgid "Map"
70−msgstr ""
70+msgstr "Mapa"
7171
7272#: Applications/applications.js:96
7373msgid "Pinterest"
74−msgstr ""
74+msgstr "Pinterest"
7575
7676#: Applications/applications.js:101
7777msgid "SoundCloud"
78−msgstr ""
78+msgstr "SoundCloud"
7979
8080#: Applications/applications.js:106
8181msgid "Wikipedia"
82−msgstr ""
82+msgstr "Wikipedia"
8383
8484#: Applications/applications.js:111
8585msgid "YouTube"
86−msgstr ""
86+msgstr "YouTube"
8787
8888#: Components/PageHeader.qml:300
8989msgid "Recent searches"
@@ -135,15 +135,15 @@ msgstr "Inicio"
135135
136136#: Dash/DashMusic.qml:27 Dash/DashVideos.qml:28
137137msgid "Featured"
138−msgstr ""
138+msgstr "Destacados"
139139
140140#: Dash/DashMusic.qml:28 Dash/DashVideos.qml:29
141141msgid "Recent"
142−msgstr ""
142+msgstr "Recientes"
143143
144144#: Dash/DashMusic.qml:29 Dash/DashVideos.qml:30
145145msgid "New Releases"
146−msgstr ""
146+msgstr "Lanzamientos nuevos"
147147
148148#: Dash/DashMusic.qml:30
149149msgid "Top Charting"
@@ -155,19 +155,19 @@ msgstr "Música"
155155
156156#: Dash/DashPeople.qml:31
157157msgid "Favourites"
158−msgstr ""
158+msgstr "Favoritos"
159159
160160#: Dash/DashPeople.qml:32
161161msgid "Recently in touch"
162−msgstr ""
162+msgstr "Contactados recientemente"
163163
164164#: Dash/DashPeople.qml:33
165165msgid "New Contacts"
166−msgstr ""
166+msgstr "Contactos nuevos"
167167
168168#: Dash/DashPeople.qml:34
169169msgid "A-Z"
170−msgstr ""
170+msgstr "A-Z"
171171
172172#: Dash/DashPeople.qml:123
173173msgid "People"
@@ -175,7 +175,7 @@ msgstr "Gente"
175175
176176#: Dash/DashVideos.qml:31
177177msgid "Popular Online"
178−msgstr ""
178+msgstr "Populares en lìnea"
179179
180180#: Dash/DashVideos.qml:155
181181msgid "Videos"
@@ -183,15 +183,15 @@ msgstr "Vídeos"
183183
184184#: Dash/Video/VideoPreview.qml:98
185185msgid "Directed by:"
186−msgstr ""
186+msgstr "Dirigida por:"
187187
188188#: Dash/Video/VideoPreview.qml:121
189189msgid "Starring:"
190−msgstr ""
190+msgstr "Protagonistas:"
191191
192192#: Dash/Video/VideoPreview.qml:144
193193msgid "Author:"
194−msgstr ""
194+msgstr "Autor:"
195195
196196#: Hud/HudParametrizedActionsPage.qml:132
197197msgid "Confirm"
po/zh_CN.po+32−32
@@ -8,82 +8,82 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-06-08 14:40+0200\n"
11−"PO-Revision-Date: 2013-06-05 22:20+0000\n"
12−"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11+"PO-Revision-Date: 2013-06-13 11:35+0000\n"
12+"Last-Translator: Wylmer Wang <Unknown>\n"
1313"Language-Team: Chinese (Simplified) <zh_CN@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-06-11 06:34+0000\n"
17+"X-Launchpad-Export-Date: 2013-06-14 07:06+0000\n"
1818"X-Generator: Launchpad (build 16667)\n"
1919
2020#: Applications/applications.js:23
2121msgid "Phone"
22−msgstr ""
22+msgstr "电话"
2323
2424#: Applications/applications.js:29
2525msgid "Camera"
26−msgstr ""
26+msgstr "相机"
2727
2828#: Applications/applications.js:35
2929msgid "Gallery"
30−msgstr ""
30+msgstr "相册"
3131
3232#: Applications/applications.js:40
3333msgid "Facebook"
34−msgstr ""
34+msgstr "Facebook"
3535
3636#: Applications/applications.js:46
3737msgid "Browser"
38−msgstr ""
38+msgstr "浏览器"
3939
4040#: Applications/applications.js:51
4141msgid "Twitter"
42−msgstr ""
42+msgstr "Twitter"
4343
4444#: Applications/applications.js:57
4545msgid "GMail"
46−msgstr ""
46+msgstr "GMail"
4747
4848#: Applications/applications.js:62
4949msgid "Weather"
50−msgstr ""
50+msgstr "天气"
5151
5252#: Applications/applications.js:68
5353msgid "Notepad"
54−msgstr ""
54+msgstr "记事本"
5555
5656#: Applications/applications.js:74
5757msgid "Calendar"
58−msgstr ""
58+msgstr "日历"
5959
6060#: Applications/applications.js:80
6161msgid "Media Player"
62−msgstr ""
62+msgstr "媒体播放器"
6363
6464#: Applications/applications.js:86
6565msgid "Evernote"
66−msgstr ""
66+msgstr "印象笔记"
6767
6868#: Applications/applications.js:91
6969msgid "Map"
70−msgstr ""
70+msgstr "地图"
7171
7272#: Applications/applications.js:96
7373msgid "Pinterest"
74−msgstr ""
74+msgstr "Pinterest"
7575
7676#: Applications/applications.js:101
7777msgid "SoundCloud"
78−msgstr ""
78+msgstr "SoundCloud"
7979
8080#: Applications/applications.js:106
8181msgid "Wikipedia"
82−msgstr ""
82+msgstr "维基百科"
8383
8484#: Applications/applications.js:111
8585msgid "YouTube"
86−msgstr ""
86+msgstr "YouTube"
8787
8888#: Components/PageHeader.qml:300
8989msgid "Recent searches"
@@ -135,19 +135,19 @@ msgstr "主页"
135135
136136#: Dash/DashMusic.qml:27 Dash/DashVideos.qml:28
137137msgid "Featured"
138−msgstr ""
138+msgstr "推荐"
139139
140140#: Dash/DashMusic.qml:28 Dash/DashVideos.qml:29
141141msgid "Recent"
142−msgstr ""
142+msgstr "最近"
143143
144144#: Dash/DashMusic.qml:29 Dash/DashVideos.qml:30
145145msgid "New Releases"
146−msgstr ""
146+msgstr "新版本"
147147
148148#: Dash/DashMusic.qml:30
149149msgid "Top Charting"
150−msgstr ""
150+msgstr "排行榜图"
151151
152152#: Dash/DashMusic.qml:99
153153msgid "Music"
@@ -155,19 +155,19 @@ msgstr "音乐"
155155
156156#: Dash/DashPeople.qml:31
157157msgid "Favourites"
158−msgstr ""
158+msgstr "最爱"
159159
160160#: Dash/DashPeople.qml:32
161161msgid "Recently in touch"
162−msgstr ""
162+msgstr "最近联系"
163163
164164#: Dash/DashPeople.qml:33
165165msgid "New Contacts"
166−msgstr ""
166+msgstr "新建联系人"
167167
168168#: Dash/DashPeople.qml:34
169169msgid "A-Z"
170−msgstr ""
170+msgstr "A-Z"
171171
172172#: Dash/DashPeople.qml:123
173173msgid "People"
@@ -175,7 +175,7 @@ msgstr "联系人"
175175
176176#: Dash/DashVideos.qml:31
177177msgid "Popular Online"
178−msgstr ""
178+msgstr "经常在线"
179179
180180#: Dash/DashVideos.qml:155
181181msgid "Videos"
@@ -183,15 +183,15 @@ msgstr "视频"
183183
184184#: Dash/Video/VideoPreview.qml:98
185185msgid "Directed by:"
186−msgstr ""
186+msgstr "导演:"
187187
188188#: Dash/Video/VideoPreview.qml:121
189189msgid "Starring:"
190−msgstr ""
190+msgstr "主演:"
191191
192192#: Dash/Video/VideoPreview.qml:144
193193msgid "Author:"
194−msgstr ""
194+msgstr "作者:"
195195
196196#: Hud/HudParametrizedActionsPage.qml:132
197197msgid "Confirm"
tests/qmltests/Greeter/tst_Phone.qml+13−8
@@ -46,17 +46,22 @@ Item {
4646 compare(greeter.narrowMode, true)
4747 }
4848
49− function test_teasingArea() {
50− tryCompare(greeter, "leftTeaserPressed", false)
51− mousePress(greeter, units.gu(2), greeter.height - units.gu(1))
52− tryCompare(greeter, "leftTeaserPressed", true)
53− mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
54− tryCompare(greeter, "leftTeaserPressed", false)
49+ function test_teasingArea_data() {
50+ return [
51+ {tag: "left", posX: units.gu(2), leftPressed: true, rightPressed: false},
52+ {tag: "right", posX: greeter.width - units.gu(2), leftPressed: false, rightPressed: true}
53+ ]
54+ }
5555
56− mousePress(greeter, greeter.width - units.gu(2), greeter.height - units.gu(1))
56+ function test_teasingArea(data) {
5757 tryCompare(greeter, "leftTeaserPressed", false)
58− mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
58+ tryCompare(greeter, "rightTeaserPressed", false)
59+ mousePress(greeter, data.posX, greeter.height - units.gu(1))
60+ tryCompare(greeter, "leftTeaserPressed", data.leftPressed)
61+ tryCompare(greeter, "rightTeaserPressed", data.rightPressed)
62+ mouseRelease(greeter, data.posX, greeter.height - units.gu(1))
5963 tryCompare(greeter, "leftTeaserPressed", false)
64+ tryCompare(greeter, "rightTeaserPressed", false)
6065 }
6166 }
6267}
tests/qmltests/Greeter/tst_Tablet.qml+19
@@ -305,5 +305,24 @@ Item {
305305 var index = select_user("no-background")
306306 compare(greeter.model.data(index, LightDM.UserRoles.BackgroundPathRole), "")
307307 }
308+
309+ function test_teasingArea_data() {
310+ return [
311+ {tag: "left", posX: units.gu(2), leftPressed: true, rightPressed: false},
312+ {tag: "right", posX: greeter.width - units.gu(2), leftPressed: false, rightPressed: true}
313+ ]
314+ }
315+
316+ function test_teasingArea(data) {
317+ tryCompare(greeter, "leftTeaserPressed", false)
318+ tryCompare(greeter, "rightTeaserPressed", false)
319+ mousePress(greeter, data.posX, greeter.height - units.gu(1))
320+ tryCompare(greeter, "leftTeaserPressed", data.leftPressed)
321+ tryCompare(greeter, "rightTeaserPressed", data.rightPressed)
322+ mouseRelease(greeter, data.posX, greeter.height - units.gu(1))
323+ tryCompare(greeter, "leftTeaserPressed", false)
324+ tryCompare(greeter, "rightTeaserPressed", false)
325+ }
326+
308327 }
309328}