on xenial help sign in
merge prereq
1f8ab9cLukáš Tinkl
qml/Launcher/Drawer.qml+12−15
@@ -169,7 +169,7 @@ FocusScope {
169 Loader {
169 Loader {
170 id: listLoader
170 id: listLoader
171 objectName: "drawerListLoader"
171 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 }
173
173
174 KeyNavigation.up: headerFocusScope
174 KeyNavigation.up: headerFocusScope
175 KeyNavigation.down: searchField
175 KeyNavigation.down: searchField
@@ -241,7 +241,8 @@ FocusScope {
241 }
241 }
242
242
243 delegate: UbuntuShape {
243 delegate: UbuntuShape {
244− width: parent.width
244+ width: parent.width - units.gu(2)
245+ anchors.horizontalCenter: parent.horizontalCenter
245 color: "#20ffffff"
246 color: "#20ffffff"
246 aspect: UbuntuShape.Flat
247 aspect: UbuntuShape.Flat
247 // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
248 // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
@@ -289,7 +290,8 @@ FocusScope {
289 }
290 }
290
291
291 delegate: UbuntuShape {
292 delegate: UbuntuShape {
292− width: parent.width
293+ width: parent.width - units.gu(2)
294+ anchors.horizontalCenter: parent.horizontalCenter
293 color: "#20ffffff"
295 color: "#20ffffff"
294 aspect: UbuntuShape.Flat
296 aspect: UbuntuShape.Flat
295
297
@@ -313,9 +315,6 @@ FocusScope {
313
315
314 interactive: true
316 interactive: true
315 focus: index == aToZListView.currentIndex
317 focus: index == aToZListView.currentIndex
316− onFocusChanged: print("drawer grid", index, "has focus", focus)
317−
318− onCurrentIndexChanged: print("grid currentIndex changed", currentIndex)
319
318
320 model: AppDrawerProxyModel {
319 model: AppDrawerProxyModel {
321 id: categoryModel
320 id: categoryModel
@@ -365,15 +364,13 @@ FocusScope {
365 }
364 }
366 sourceFillMode: UbuntuShape.PreserveAspectCrop
365 sourceFillMode: UbuntuShape.PreserveAspectCrop
367
366
368− Image {
367+ StyledItem {
369− objectName: "focusRing"
368+ styleName: "FocusShape"
370− anchors.centerIn: parent
369+ anchors.fill: parent
371− height: width * 15 / 16
370+ StyleHints {
372− width: parent.width + units.gu(1)
371+ visible: drawerDelegate.focused
373− source: "graphics/launcher-app-focus-ring.svg"
372+ radius: units.gu(2.55)
374− sourceSize.width: width
373+ }
375− sourceSize.height: height
376− visible: drawerDelegate.focused
377 }
374 }
378 }
375 }
379
376
qml/Launcher/LauncherDelegate.qml+8−9
@@ -124,15 +124,14 @@ Item {
124 height: parent.itemHeight + units.gu(1)
124 height: parent.itemHeight + units.gu(1)
125 anchors.centerIn: parent
125 anchors.centerIn: parent
126
126
127− Image {
127+ StyledItem {
128− objectName: "focusRing"
128+ styleName: "FocusShape"
129− anchors.centerIn: iconShape
129+ anchors.fill: iconShape
130− height: width * 15 / 16
130+ activeFocusOnTab: true
131− width: iconShape.width + units.gu(1)
131+ StyleHints {
132− source: "graphics/launcher-app-focus-ring.svg"
132+ visible: root.highlighted
133− sourceSize.width: width
133+ radius: units.gu(2.55)
134− sourceSize.height: height
134+ }
135− visible: root.highlighted
136 }
135 }
137
136
138 ProportionalShape {
137 ProportionalShape {
qml/Launcher/LauncherPanel.qml+9−6
@@ -80,6 +80,7 @@ Rectangle {
80 }
80 }
81
81
82 Rectangle {
82 Rectangle {
83+ id: bfb
83 objectName: "buttonShowDashHome"
84 objectName: "buttonShowDashHome"
84 width: parent.width
85 width: parent.width
85 height: width * .9
86 height: width * .9
@@ -100,13 +101,15 @@ Rectangle {
100 activeFocusOnPress: false
101 activeFocusOnPress: false
101 onClicked: root.showDashHome()
102 onClicked: root.showDashHome()
102 }
103 }
103− Rectangle {
104+
104− objectName: "bfbFocusHighlight"
105+ StyledItem {
106+ styleName: "FocusShape"
105 anchors.fill: parent
107 anchors.fill: parent
106− border.color: "white"
108+ anchors.margins: units.gu(.5)
107− border.width: units.dp(1)
109+ StyleHints {
108− color: "transparent"
109− visible: parent.highlighted
110+ visible: bfb.highlighted
111+ radius: 0
112+ }
110 }
113 }
111 }
114 }
112
115
qml/Launcher/MoreAppsHeader.qml+12−2
@@ -7,11 +7,21 @@ AbstractButton {
7 property bool highlighted: false
7 property bool highlighted: false
8
8
9 UbuntuShape {
9 UbuntuShape {
10− width: parent.width
10+ width: parent.width - units.gu(2)
11+ anchors.horizontalCenter: parent.horizontalCenter
11 height: parent.height - units.gu(1)
12 height: parent.height - units.gu(1)
12− color: root.highlighted ? "red" : "#20ffffff"
13+ color: "#20ffffff"
13 aspect: UbuntuShape.Flat
14 aspect: UbuntuShape.Flat
14
15
16+ StyledItem {
17+ styleName: "FocusShape"
18+ anchors.fill: parent
19+ activeFocusOnTab: true
20+ StyleHints {
21+ visible: root.highlighted
22+ }
23+ }
24+
15 Row {
25 Row {
16 anchors.fill: parent
26 anchors.fill: parent
17 anchors.margins: units.gu(1)
27 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 {
351 onLoaded: {
351 onLoaded: {
352 item.objectName = "greeter"
352 item.objectName = "greeter"
353 }
353 }
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+ }
354 }
364 }
355
365
356 Component {
366 Component {
@@ -442,9 +452,11 @@ StyledItem {
442 if (shell.mode === "greeter") {
452 if (shell.mode === "greeter") {
443 SessionBroadcast.requestHomeShown(AccountsService.user);
453 SessionBroadcast.requestHomeShown(AccountsService.user);
444 } else {
454 } else {
445− var animate = !LightDMService.greeter.active && !stages.shown;
455+ if (!greeter.active) {
446− dash.setCurrentScope(0, animate, false);
456+ launcher.openDrawer(false);
447− ApplicationManager.requestFocusApplication("unity8-dash");
457+ } else {
458+ greeterLoader.openDrawerAfterUnlock = true;
459+ }
448 }
460 }
449 }
461 }
450
462
@@ -515,7 +527,7 @@ StyledItem {
515 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
527 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
516 blurSource: greeter.shown ? greeter : stages
528 blurSource: greeter.shown ? greeter : stages
517 topPanelHeight: panel.panelHeight
529 topPanelHeight: panel.panelHeight
518− drawerEnabled: !greeter.shown
530+ drawerEnabled: !greeter.active
519
531
520 onShowDashHome: showHome()
532 onShowDashHome: showHome()
521 onLauncherApplicationSelected: {
533 onLauncherApplicationSelected: {
tests/qmltests/Launcher/tst_Drawer.qml+2−2
@@ -268,9 +268,9 @@ StyledItem {
268 tryCompare(drawer, "focus", true);
268 tryCompare(drawer, "focus", true);
269
269
270 var searchField = findChild(drawer, "searchField");
270 var searchField = findChild(drawer, "searchField");
271− verify(searchField);
271+ tryCompareFunction(function() { return !!searchField }, true);
272 typeString("cam");
272 typeString("cam");
273− tryCompare(searchField, "displayText", "cam");
273+ tryCompareFunction(function() { return searchField.displayText }, "cam");
274 }
274 }
275
275
276 function test_kbdNavigation() {
276 function test_kbdNavigation() {
tests/qmltests/Launcher/tst_Launcher.qml+3−4
@@ -369,18 +369,17 @@ Rectangle {
369 function assertFocusOnIndex(index) {
369 function assertFocusOnIndex(index) {
370 var launcherPanel = findChild(launcher, "launcherPanel");
370 var launcherPanel = findChild(launcher, "launcherPanel");
371 var launcherListView = findChild(launcher, "launcherListView");
371 var launcherListView = findChild(launcher, "launcherListView");
372− var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
372+ var bfb = findChild(launcher, "buttonShowDashHome");
373
373
374 waitForRendering(launcher);
374 waitForRendering(launcher);
375 tryCompare(launcherPanel, "highlightIndex", index);
375 tryCompare(launcherPanel, "highlightIndex", index);
376− compare(bfbFocusHighlight.visible, index === -1);
376+ compare(bfb.highlighted, index === -1);
377 for (var i = 0; i < launcherListView.count; i++) {
377 for (var i = 0; i < launcherListView.count; i++) {
378 var item = findChild(launcher, "launcherDelegate" + i);
378 var item = findChild(launcher, "launcherDelegate" + i);
379 // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
379 // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
380 // Make sure the requested index does have focus. for the others, try best effort to check if they don't
380 // Make sure the requested index does have focus. for the others, try best effort to check if they don't
381 if (index === i || item) {
381 if (index === i || item) {
382− var focusRing = findChild(item, "focusRing")
383− tryCompare(focusRing, "visible", index === i);
382+ tryCompare(item, "highlighted", index === i);
384 }
383 }
385 }
384 }
386 }
385 }
tests/qmltests/tst_ShellWithPin.qml+18−1
@@ -556,5 +556,22 @@ Item {
556 var lockscreen = findChild(shell, "lockscreen");
556 var lockscreen = findChild(shell, "lockscreen");
557 verify(lockscreen.shown);
557 verify(lockscreen.shown);
558 }
558 }
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+ }
559− }
576+ }
560}
577}