on xenial help sign in
add a highlight for the bfb
b8d3575Michael Zanetti
qml/Launcher/LauncherPanel.qml+10−11
@@ -79,22 +79,13 @@ Rectangle {
79 fill: parent
79 fill: parent
80 }
80 }
81
81
82− Item {
82+ Rectangle {
83 objectName: "buttonShowDashHome"
83 objectName: "buttonShowDashHome"
84 width: parent.width
84 width: parent.width
85 height: units.gu(7)
85 height: units.gu(7)
86− clip: true
86+ color: UbuntuColors.orange
87 property bool highlighted: root.highlightIndex == -1;
87 property bool highlighted: root.highlightIndex == -1;
88
88
89− UbuntuShape {
90− anchors {
91− fill: parent
92− topMargin: -units.gu(2)
93− }
94− aspect: UbuntuShape.Flat
95− backgroundColor: UbuntuColors.orange
96− }
97−
98 Image {
89 Image {
99 objectName: "dashItem"
90 objectName: "dashItem"
100 width: units.gu(5)
91 width: units.gu(5)
@@ -108,6 +99,14 @@ Rectangle {
108 anchors.fill: parent
99 anchors.fill: parent
109 onClicked: root.showDashHome()
100 onClicked: root.showDashHome()
110 }
101 }
102+ Rectangle {
103+ objectName: "bfbFocusHighlight"
104+ anchors.fill: parent
105+ border.color: "white"
106+ border.width: units.dp(2)
107+ color: "transparent"
108+ visible: parent.highlighted
109+ }
111 }
110 }
112
111
113 Item {
112 Item {
tests/qmltests/Launcher/tst_Launcher.qml+5−5
@@ -896,20 +896,20 @@ Item {
896
896
897 function test_focusRingFollowsHighlightIndex() {
897 function test_focusRingFollowsHighlightIndex() {
898 launcherLoader.forceActiveFocus()
898 launcherLoader.forceActiveFocus()
899− var bfb = findChild(launcher, "buttonShowDashHome");
899+ var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
900 var focusRing0 = findChild(findChild(launcher, "launcherDelegate0"), "focusRing");
900 var focusRing0 = findChild(findChild(launcher, "launcherDelegate0"), "focusRing");
901 var focusRing1 = findChild(findChild(launcher, "launcherDelegate1"), "focusRing");
901 var focusRing1 = findChild(findChild(launcher, "launcherDelegate1"), "focusRing");
902 var focusRing2 = findChild(findChild(launcher, "launcherDelegate2"), "focusRing");
902 var focusRing2 = findChild(findChild(launcher, "launcherDelegate2"), "focusRing");
903
903
904− compare(bfb.highlighted, false);
904+ compare(bfbFocusHighlight.visible, false);
905 compare(focusRing0.visible, false);
905 compare(focusRing0.visible, false);
906 compare(focusRing1.visible, false);
906 compare(focusRing1.visible, false);
907 compare(focusRing2.visible, false);
907 compare(focusRing2.visible, false);
908
908
909 launcher.superTabPressed = true;
909 launcher.superTabPressed = true;
910− tryCompare(bfb, "highlighted", true);
910+ tryCompare(bfbFocusHighlight, "visible", true);
911 keyClick(Qt.Key_Tab);
911 keyClick(Qt.Key_Tab);
912− tryCompare(bfb, "highlighted", false);
912+ tryCompare(bfbFocusHighlight, "visible", false);
913 tryCompare(focusRing0, "visible", true);
913 tryCompare(focusRing0, "visible", true);
914 keyClick(Qt.Key_Tab);
914 keyClick(Qt.Key_Tab);
915 tryCompare(focusRing0, "visible", false);
915 tryCompare(focusRing0, "visible", false);
@@ -926,7 +926,7 @@ Item {
926 tryCompare(focusRing0, "visible", true);
926 tryCompare(focusRing0, "visible", true);
927 keyClick(Qt.Key_Backtab);
927 keyClick(Qt.Key_Backtab);
928 tryCompare(focusRing0, "visible", false);
928 tryCompare(focusRing0, "visible", false);
929− tryCompare(bfb, "highlighted", true);
929+ tryCompare(bfbFocusHighlight, "visible", true);
930 }
930 }
931
931
932 function test_longpressSuperKeyShowsHints() {
932 function test_longpressSuperKeyShowsHints() {