on xenial help sign in
added proper highlight
commita7b4fbe61f6aa7a2ae068476f9b709611107dbf8 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 8 Apr 2015, 14:42 (12 years ago) parent21675ad
2 files changed+19−10
qml/Stages/DecoratedWindow.qml+17 qml/Stages/DesktopStage.qml+2−10
qml/Stages/DecoratedWindow.qml+17
@@ -28,6 +28,8 @@ FocusScope {
2828 property alias active: decoration.active
2929
3030 property bool decorationShown: true
31+ property bool highlightShown: false
32+ property real highlightScale: 1
3133
3234 signal close();
3335 signal maximize();
@@ -43,6 +45,21 @@ FocusScope {
4345 Behavior on opacity { UbuntuNumberAnimation {} }
4446 }
4547
48+ Rectangle {
49+ id: selectionHighlight
50+ anchors.fill: parent
51+ anchors.margins: -units.gu(1) * root.highlightScale
52+ color: "white"
53+ opacity: highlightShown ? 0.15 : 0
54+ }
55+
56+ Rectangle {
57+ anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
58+ height: units.dp(2) * root.highlightScale
59+ color: UbuntuColors.orange
60+ visible: root.highlightShown
61+ }
62+
4663 WindowDecoration {
4764 id: decoration
4865 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
qml/Stages/DesktopStage.qml+2−10
@@ -164,13 +164,10 @@ FocusScope {
164164 itemScaleOriginY: appDelegate.height;
165165 z: index
166166 }
167− PropertyChanges {
168− target: darkenOverlay
169− opacity: index != appRepeater.highlightedIndex ? 0.4 : 0
170− }
171167 PropertyChanges {
172168 target: decoratedWindow
173169 decorationShown: false
170+ highlightShown: index == appRepeater.highlightedIndex
174171 }
175172 PropertyChanges {
176173 target: tileInfo
@@ -217,6 +214,7 @@ FocusScope {
217214 anchors.fill: parent
218215 application: ApplicationManager.get(index)
219216 active: ApplicationManager.focusedApplicationId === model.appId
217+ highlightScale: 1 / appDelegate.itemScale
220218
221219 onFocusChanged: {
222220 if (focus) {
@@ -241,12 +239,6 @@ FocusScope {
241239 angle: appDelegate.angle
242240 }
243241 ]
244− Rectangle {
245− id: darkenOverlay
246− anchors.fill: parent
247− color: "black"
248− opacity: 0
249− }
250242 }
251243
252244