on xenial help sign in
merge prereq
commit1f8ab9cc66ae4e7db1be394695a27d23f27434e6 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 9 Jan 2017, 14:23 (10 years ago) parent67018675a43f5a
9 files changed+80−55
qml/Launcher/Drawer.qml+12−15 qml/Launcher/LauncherDelegate.qml+8−9 qml/Launcher/LauncherPanel.qml+9−6 qml/Launcher/MoreAppsHeader.qml+12−2 qml/Launcher/graphics/launcher-app-focus-ring.svg−12 qml/Shell.qml+16−4 tests/qmltests/Launcher/tst_Drawer.qml+2−2 tests/qmltests/Launcher/tst_Launcher.qml+3−4 tests/qmltests/tst_ShellWithPin.qml+18−1
qml/Launcher/Drawer.qml+12−15
@@ -169,7 +169,7 @@ FocusScope {
169169 Loader {
170170 id: listLoader
171171 objectName: "drawerListLoader"
172− anchors { left: parent.left; top: sectionsContainer.bottom; right: parent.right; bottom: parent.bottom; leftMargin: units.gu(1); rightMargin: units.gu(1) }
172+ anchors { left: parent.left; top: sectionsContainer.bottom; right: parent.right; bottom: parent.bottom }
173173
174174 KeyNavigation.up: headerFocusScope
175175 KeyNavigation.down: searchField
@@ -241,7 +241,8 @@ FocusScope {
241241 }
242242
243243 delegate: UbuntuShape {
244− width: parent.width
244+ width: parent.width - units.gu(2)
245+ anchors.horizontalCenter: parent.horizontalCenter
245246 color: "#20ffffff"
246247 aspect: UbuntuShape.Flat
247248 // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
@@ -289,7 +290,8 @@ FocusScope {
289290 }
290291
291292 delegate: UbuntuShape {
292− width: parent.width
293+ width: parent.width - units.gu(2)
294+ anchors.horizontalCenter: parent.horizontalCenter
293295 color: "#20ffffff"
294296 aspect: UbuntuShape.Flat
295297
@@ -313,9 +315,6 @@ FocusScope {
313315
314316 interactive: true
315317 focus: index == aToZListView.currentIndex
316− onFocusChanged: print("drawer grid", index, "has focus", focus)
317−
318− onCurrentIndexChanged: print("grid currentIndex changed", currentIndex)
319318
320319 model: AppDrawerProxyModel {
321320 id: categoryModel
@@ -365,15 +364,13 @@ FocusScope {
365364 }
366365 sourceFillMode: UbuntuShape.PreserveAspectCrop
367366
368− Image {
369− objectName: "focusRing"
370− anchors.centerIn: parent
371− height: width * 15 / 16
372− width: parent.width + units.gu(1)
373− source: "graphics/launcher-app-focus-ring.svg"
374− sourceSize.width: width
375− sourceSize.height: height
376− visible: drawerDelegate.focused
367+ StyledItem {
368+ styleName: "FocusShape"
369+ anchors.fill: parent
370+ StyleHints {
371+ visible: drawerDelegate.focused
372+ radius: units.gu(2.55)
373+ }
377374 }
378375 }
379376
qml/Launcher/LauncherDelegate.qml+8−9
@@ -124,15 +124,14 @@ Item {
124124 height: parent.itemHeight + units.gu(1)
125125 anchors.centerIn: parent
126126
127− Image {
128− objectName: "focusRing"
129− anchors.centerIn: iconShape
130− height: width * 15 / 16
131− width: iconShape.width + units.gu(1)
132− source: "graphics/launcher-app-focus-ring.svg"
133− sourceSize.width: width
134− sourceSize.height: height
135− visible: root.highlighted
127+ StyledItem {
128+ styleName: "FocusShape"
129+ anchors.fill: iconShape
130+ activeFocusOnTab: true
131+ StyleHints {
132+ visible: root.highlighted
133+ radius: units.gu(2.55)
134+ }
136135 }
137136
138137 ProportionalShape {
qml/Launcher/LauncherPanel.qml+9−6
@@ -80,6 +80,7 @@ Rectangle {
8080 }
8181
8282 Rectangle {
83+ id: bfb
8384 objectName: "buttonShowDashHome"
8485 width: parent.width
8586 height: width * .9
@@ -100,13 +101,15 @@ Rectangle {
100101 activeFocusOnPress: false
101102 onClicked: root.showDashHome()
102103 }
103− Rectangle {
104− objectName: "bfbFocusHighlight"
104+
105+ StyledItem {
106+ styleName: "FocusShape"
105107 anchors.fill: parent
106− border.color: "white"
107− border.width: units.dp(1)
108− color: "transparent"
109− visible: parent.highlighted
108+ anchors.margins: units.gu(.5)
109+ StyleHints {
110+ visible: bfb.highlighted
111+ radius: 0
112+ }
110113 }
111114 }
112115
qml/Launcher/MoreAppsHeader.qml+12−2
@@ -7,11 +7,21 @@ AbstractButton {
77 property bool highlighted: false
88
99 UbuntuShape {
10− width: parent.width
10+ width: parent.width - units.gu(2)
11+ anchors.horizontalCenter: parent.horizontalCenter
1112 height: parent.height - units.gu(1)
12− color: root.highlighted ? "red" : "#20ffffff"
13+ color: "#20ffffff"
1314 aspect: UbuntuShape.Flat
1415
16+ StyledItem {
17+ styleName: "FocusShape"
18+ anchors.fill: parent
19+ activeFocusOnTab: true
20+ StyleHints {
21+ visible: root.highlighted
22+ }
23+ }
24+
1525 Row {
1626 anchors.fill: parent
1727 anchors.margins: units.gu(1)
qml/Launcher/graphics/launcher-app-focus-ring.svgdeleted−12
@@ -1,12 +0,0 @@
1−<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2−<svg width="172px" height="163px" viewBox="0 0 172 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3− <!-- Generator: Sketch 3.4.4 (17249) - http://www.bohemiancoding.com/sketch -->
4− <title>Shape</title>
5− <desc>Created with Sketch.</desc>
6− <defs></defs>
7− <g id="•-Launcher" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8− <g id="Artboard-9" sketch:type="MSArtboardGroup" transform="translate(-163.000000, -1436.000000)" fill="#E95420">
9− <path d="M221.983432,1440 L221.983432,1440 C195.6127,1440 184.708233,1442.4723 177.107949,1450.10734 C169.476819,1457.77336 167,1468.79245 167,1495.3481 L167,1538.9019 C167,1565.45755 169.476819,1576.47664 177.107949,1584.14266 C184.708233,1591.7777 195.6127,1594.25 221.983432,1594.25 L276.016868,1594.25 C302.387595,1594.25 313.291998,1591.77771 320.892221,1584.14264 C328.523252,1576.47663 331,1565.45769 331,1538.9019 L331,1495.3481 C331,1468.79231 328.523252,1457.77337 320.892221,1450.10736 C313.291998,1442.47229 302.387595,1440 276.016868,1440 L221.983432,1440 Z M221.983432,1436 L276.016868,1436 C302.345315,1436 314.848953,1438.36655 323.727108,1447.2854 C332.633306,1456.23243 335,1468.85167 335,1495.3481 L335,1538.9019 C335,1565.39833 332.633306,1578.01757 323.727108,1586.9646 C314.848953,1595.88345 302.345315,1598.25 276.016868,1598.25 L221.983432,1598.25 C195.654985,1598.25 183.151291,1595.88345 174.273077,1586.96463 C165.366772,1578.0176 163,1565.39822 163,1538.9019 L163,1495.3481 C163,1468.85178 165.366772,1456.2324 174.273077,1447.28537 C183.151291,1438.36655 195.654985,1436 221.983432,1436 L221.983432,1436 Z" id="Shape" sketch:type="MSShapeGroup"></path>
10− </g>
11− </g>
12−</svg>
qml/Shell.qml+16−4
@@ -351,6 +351,16 @@ StyledItem {
351351 onLoaded: {
352352 item.objectName = "greeter"
353353 }
354+ property bool openDrawerAfterUnlock: false
355+ Connections {
356+ target: greeter
357+ onActiveChanged: {
358+ if (!greeter.active && greeterLoader.openDrawerAfterUnlock) {
359+ launcher.openDrawer(false);
360+ greeterLoader.openDrawerAfterUnlock = false;
361+ }
362+ }
363+ }
354364 }
355365
356366 Component {
@@ -442,9 +452,11 @@ StyledItem {
442452 if (shell.mode === "greeter") {
443453 SessionBroadcast.requestHomeShown(AccountsService.user);
444454 } else {
445− var animate = !LightDMService.greeter.active && !stages.shown;
446− dash.setCurrentScope(0, animate, false);
447− ApplicationManager.requestFocusApplication("unity8-dash");
455+ if (!greeter.active) {
456+ launcher.openDrawer(false);
457+ } else {
458+ greeterLoader.openDrawerAfterUnlock = true;
459+ }
448460 }
449461 }
450462
@@ -515,7 +527,7 @@ StyledItem {
515527 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
516528 blurSource: greeter.shown ? greeter : stages
517529 topPanelHeight: panel.panelHeight
518− drawerEnabled: !greeter.shown
530+ drawerEnabled: !greeter.active
519531
520532 onShowDashHome: showHome()
521533 onLauncherApplicationSelected: {
tests/qmltests/Launcher/tst_Drawer.qml+2−2
@@ -268,9 +268,9 @@ StyledItem {
268268 tryCompare(drawer, "focus", true);
269269
270270 var searchField = findChild(drawer, "searchField");
271− verify(searchField);
271+ tryCompareFunction(function() { return !!searchField }, true);
272272 typeString("cam");
273− tryCompare(searchField, "displayText", "cam");
273+ tryCompareFunction(function() { return searchField.displayText }, "cam");
274274 }
275275
276276 function test_kbdNavigation() {
tests/qmltests/Launcher/tst_Launcher.qml+3−4
@@ -369,18 +369,17 @@ Rectangle {
369369 function assertFocusOnIndex(index) {
370370 var launcherPanel = findChild(launcher, "launcherPanel");
371371 var launcherListView = findChild(launcher, "launcherListView");
372− var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
372+ var bfb = findChild(launcher, "buttonShowDashHome");
373373
374374 waitForRendering(launcher);
375375 tryCompare(launcherPanel, "highlightIndex", index);
376− compare(bfbFocusHighlight.visible, index === -1);
376+ compare(bfb.highlighted, index === -1);
377377 for (var i = 0; i < launcherListView.count; i++) {
378378 var item = findChild(launcher, "launcherDelegate" + i);
379379 // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
380380 // Make sure the requested index does have focus. for the others, try best effort to check if they don't
381381 if (index === i || item) {
382− var focusRing = findChild(item, "focusRing")
383− tryCompare(focusRing, "visible", index === i);
382+ tryCompare(item, "highlighted", index === i);
384383 }
385384 }
386385 }
tests/qmltests/tst_ShellWithPin.qml+18−1
@@ -556,5 +556,22 @@ Item {
556556 var lockscreen = findChild(shell, "lockscreen");
557557 verify(lockscreen.shown);
558558 }
559− }
559+
560+ function test_bfbOnLockedDevice() {
561+ var launcher = findChild(shell, "launcher");
562+ touchFlick(shell, units.gu(.5), shell.height / 2, units.gu(10), shell.height / 2);
563+
564+ tryCompare(launcher, "x", 0);
565+ tryCompare(launcher, "state", "visible");
566+
567+ waitForRendering(shell)
568+
569+ var bfb = findChild(launcher, "buttonShowDashHome");
570+ mouseClick(bfb, bfb.width / 2, bfb.height / 2);
571+
572+ enterPin("1234")
573+
574+ tryCompare(launcher, "state", "drawer");
575+ }
576+ }
560577}