on xenial help sign in
replace custom focus ring with SDK one
commitd11044c0b376c6cf07992e3ec3e1c6022e5f3a6f authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 9 Jan 2017, 12:29 (10 years ago) parent696c8cb
8 files changed+83−46
qml/Launcher/Drawer.qml+12−12 qml/Launcher/Launcher.qml+1 qml/Launcher/LauncherDelegate.qml+9−9 qml/Launcher/LauncherPanel.qml+10−6 qml/Launcher/MoreAppsHeader.qml+12−2 qml/Launcher/graphics/launcher-app-focus-ring.svg−12 qml/Shell.qml+19−4 tests/qmltests/tst_ShellWithPin.qml+20−1
qml/Launcher/Drawer.qml+12−12
@@ -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
@@ -365,15 +367,13 @@ FocusScope {
365367 }
366368 sourceFillMode: UbuntuShape.PreserveAspectCrop
367369
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
370+ StyledItem {
371+ styleName: "FocusShape"
372+ anchors.fill: parent
373+ StyleHints {
374+ visible: drawerDelegate.focused
375+ radius: units.gu(2.55)
376+ }
377377 }
378378 }
379379
qml/Launcher/Launcher.qml+1
@@ -154,6 +154,7 @@ FocusScope {
154154
155155 function openDrawer(focusInputField) {
156156 if (!drawerEnabled) {
157+ print("bam!")
157158 return;
158159 }
159160
qml/Launcher/LauncherDelegate.qml+9−9
@@ -124,15 +124,15 @@ 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+ objectName: "focusRing"
133+ visible: root.highlighted
134+ radius: units.gu(2.55)
135+ }
136136 }
137137
138138 ProportionalShape {
qml/Launcher/LauncherPanel.qml+10−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,16 @@ 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+ objectName: "bfbFocusHighlight"
111+ visible: bfb.highlighted
112+ radius: 0
113+ }
110114 }
111115 }
112116
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+19−4
@@ -338,6 +338,18 @@ StyledItem {
338338 onLoaded: {
339339 item.objectName = "greeter"
340340 }
341+ property bool openDrawerAfterUnlock: false
342+ Connections {
343+ target: greeter
344+ onActiveChanged: {
345+ print("active changed", greeter.active, greeterLoader.openDrawerAfterUnlock)
346+ if (!greeter.active && greeterLoader.openDrawerAfterUnlock) {
347+ print("should open drawer")
348+ launcher.openDrawer(false);
349+ greeterLoader.openDrawerAfterUnlock = false;
350+ }
351+ }
352+ }
341353 }
342354
343355 Component {
@@ -429,9 +441,12 @@ StyledItem {
429441 if (shell.mode === "greeter") {
430442 SessionBroadcast.requestHomeShown(AccountsService.user);
431443 } else {
432− var animate = !LightDMService.greeter.active && !stages.shown;
433− dash.setCurrentScope(0, animate, false);
434− ApplicationManager.requestFocusApplication("unity8-dash");
444+ if (!greeter.active) {
445+ launcher.openDrawer(false);
446+ } else {
447+ greeterLoader.openDrawerAfterUnlock = true;
448+// greeter.notifyUserRequestedApp();
449+ }
435450 }
436451 }
437452
@@ -502,7 +517,7 @@ StyledItem {
502517 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
503518 blurSource: greeter.shown ? greeter : stages
504519 topPanelHeight: panel.panelHeight
505− drawerEnabled: !greeter.shown
520+ drawerEnabled: !greeter.active
506521
507522 onShowDashHome: showHome()
508523 onLauncherApplicationSelected: {
tests/qmltests/tst_ShellWithPin.qml+20−1
@@ -556,5 +556,24 @@ 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+ wait(1000)
569+
570+ var bfb = findChild(launcher, "buttonShowDashHome");
571+ mouseClick(bfb, bfb.width / 2, bfb.height / 2);
572+
573+
574+ enterPin("1234")
575+
576+ wait(2000)
577+ }
578+ }
560579}