on xenial help sign in
replace custom focus ring with SDK one
d11044cMichael Zanetti
qml/Launcher/Drawer.qml+12−12
@@ -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
@@ -365,15 +367,13 @@ FocusScope {
365 }
367 }
366 sourceFillMode: UbuntuShape.PreserveAspectCrop
368 sourceFillMode: UbuntuShape.PreserveAspectCrop
367
369
368− Image {
370+ StyledItem {
369− objectName: "focusRing"
371+ styleName: "FocusShape"
370− anchors.centerIn: parent
372+ anchors.fill: parent
371− height: width * 15 / 16
373+ StyleHints {
372− width: parent.width + units.gu(1)
374+ visible: drawerDelegate.focused
373− source: "graphics/launcher-app-focus-ring.svg"
375+ radius: units.gu(2.55)
374− sourceSize.width: width
376+ }
375− sourceSize.height: height
376− visible: drawerDelegate.focused
377 }
377 }
378 }
378 }
379
379
qml/Launcher/Launcher.qml+1
@@ -154,6 +154,7 @@ FocusScope {
154
154
155 function openDrawer(focusInputField) {
155 function openDrawer(focusInputField) {
156 if (!drawerEnabled) {
156 if (!drawerEnabled) {
157+ print("bam!")
157 return;
158 return;
158 }
159 }
159
160
qml/Launcher/LauncherDelegate.qml+9−9
@@ -124,15 +124,15 @@ 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+ styleName: "FocusShape"
129+ anchors.fill: iconShape
130+ activeFocusOnTab: true
131+ StyleHints {
128− objectName: "focusRing"
132+ objectName: "focusRing"
129− anchors.centerIn: iconShape
133+ visible: root.highlighted
130− height: width * 15 / 16
134+ radius: units.gu(2.55)
131− width: iconShape.width + units.gu(1)
135+ }
132− source: "graphics/launcher-app-focus-ring.svg"
133− sourceSize.width: width
134− sourceSize.height: height
135− visible: root.highlighted
136 }
136 }
137
137
138 ProportionalShape {
138 ProportionalShape {
qml/Launcher/LauncherPanel.qml+10−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,16 @@ 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"
110+ objectName: "bfbFocusHighlight"
109− visible: parent.highlighted
111+ visible: bfb.highlighted
112+ radius: 0
113+ }
110 }
114 }
111 }
115 }
112
116
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+19−4
@@ -338,6 +338,18 @@ StyledItem {
338 onLoaded: {
338 onLoaded: {
339 item.objectName = "greeter"
339 item.objectName = "greeter"
340 }
340 }
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+ }
341 }
353 }
342
354
343 Component {
355 Component {
@@ -429,9 +441,12 @@ StyledItem {
429 if (shell.mode === "greeter") {
441 if (shell.mode === "greeter") {
430 SessionBroadcast.requestHomeShown(AccountsService.user);
442 SessionBroadcast.requestHomeShown(AccountsService.user);
431 } else {
443 } else {
432− var animate = !LightDMService.greeter.active && !stages.shown;
444+ if (!greeter.active) {
433− dash.setCurrentScope(0, animate, false);
445+ launcher.openDrawer(false);
434− ApplicationManager.requestFocusApplication("unity8-dash");
446+ } else {
447+ greeterLoader.openDrawerAfterUnlock = true;
448+// greeter.notifyUserRequestedApp();
449+ }
435 }
450 }
436 }
451 }
437
452
@@ -502,7 +517,7 @@ StyledItem {
502 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
517 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
503 blurSource: greeter.shown ? greeter : stages
518 blurSource: greeter.shown ? greeter : stages
504 topPanelHeight: panel.panelHeight
519 topPanelHeight: panel.panelHeight
505− drawerEnabled: !greeter.shown
520+ drawerEnabled: !greeter.active
506
521
507 onShowDashHome: showHome()
522 onShowDashHome: showHome()
508 onLauncherApplicationSelected: {
523 onLauncherApplicationSelected: {
tests/qmltests/tst_ShellWithPin.qml+20−1
@@ -556,5 +556,24 @@ 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+ 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+ }
559− }
578+ }
560}
579}