on xenial help sign in
add a highlight for the bfb
commitb8d3575177740885ae91e37b94a4e2850acd9bbf authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 7 Dec 2015, 12:21 (11 years ago) parent928f7e9
2 files changed+15−16
qml/Launcher/LauncherPanel.qml+10−11 tests/qmltests/Launcher/tst_Launcher.qml+5−5
qml/Launcher/LauncherPanel.qml+10−11
@@ -79,22 +79,13 @@ Rectangle {
7979 fill: parent
8080 }
8181
82− Item {
82+ Rectangle {
8383 objectName: "buttonShowDashHome"
8484 width: parent.width
8585 height: units.gu(7)
86− clip: true
86+ color: UbuntuColors.orange
8787 property bool highlighted: root.highlightIndex == -1;
8888
89− UbuntuShape {
90− anchors {
91− fill: parent
92− topMargin: -units.gu(2)
93− }
94− aspect: UbuntuShape.Flat
95− backgroundColor: UbuntuColors.orange
96− }
97−
9889 Image {
9990 objectName: "dashItem"
10091 width: units.gu(5)
@@ -108,6 +99,14 @@ Rectangle {
10899 anchors.fill: parent
109100 onClicked: root.showDashHome()
110101 }
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+ }
111110 }
112111
113112 Item {
tests/qmltests/Launcher/tst_Launcher.qml+5−5
@@ -896,20 +896,20 @@ Item {
896896
897897 function test_focusRingFollowsHighlightIndex() {
898898 launcherLoader.forceActiveFocus()
899− var bfb = findChild(launcher, "buttonShowDashHome");
899+ var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
900900 var focusRing0 = findChild(findChild(launcher, "launcherDelegate0"), "focusRing");
901901 var focusRing1 = findChild(findChild(launcher, "launcherDelegate1"), "focusRing");
902902 var focusRing2 = findChild(findChild(launcher, "launcherDelegate2"), "focusRing");
903903
904− compare(bfb.highlighted, false);
904+ compare(bfbFocusHighlight.visible, false);
905905 compare(focusRing0.visible, false);
906906 compare(focusRing1.visible, false);
907907 compare(focusRing2.visible, false);
908908
909909 launcher.superTabPressed = true;
910− tryCompare(bfb, "highlighted", true);
910+ tryCompare(bfbFocusHighlight, "visible", true);
911911 keyClick(Qt.Key_Tab);
912− tryCompare(bfb, "highlighted", false);
912+ tryCompare(bfbFocusHighlight, "visible", false);
913913 tryCompare(focusRing0, "visible", true);
914914 keyClick(Qt.Key_Tab);
915915 tryCompare(focusRing0, "visible", false);
@@ -926,7 +926,7 @@ Item {
926926 tryCompare(focusRing0, "visible", true);
927927 keyClick(Qt.Key_Backtab);
928928 tryCompare(focusRing0, "visible", false);
929− tryCompare(bfb, "highlighted", true);
929+ tryCompare(bfbFocusHighlight, "visible", true);
930930 }
931931
932932 function test_longpressSuperKeyShowsHints() {