on xenial help sign in
added proper highlight
a7b4fbeMichael Zanetti
qml/Stages/DecoratedWindow.qml+17
@@ -28,6 +28,8 @@ FocusScope {
28 property alias active: decoration.active
28 property alias active: decoration.active
29
29
30 property bool decorationShown: true
30 property bool decorationShown: true
31+ property bool highlightShown: false
32+ property real highlightScale: 1
31
33
32 signal close();
34 signal close();
33 signal maximize();
35 signal maximize();
@@ -43,6 +45,21 @@ FocusScope {
43 Behavior on opacity { UbuntuNumberAnimation {} }
45 Behavior on opacity { UbuntuNumberAnimation {} }
44 }
46 }
45
47
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+
46 WindowDecoration {
63 WindowDecoration {
47 id: decoration
64 id: decoration
48 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
65 objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
qml/Stages/DesktopStage.qml+2−10
@@ -164,13 +164,10 @@ FocusScope {
164 itemScaleOriginY: appDelegate.height;
164 itemScaleOriginY: appDelegate.height;
165 z: index
165 z: index
166 }
166 }
167− PropertyChanges {
168− target: darkenOverlay
169− opacity: index != appRepeater.highlightedIndex ? 0.4 : 0
170− }
171 PropertyChanges {
167 PropertyChanges {
172 target: decoratedWindow
168 target: decoratedWindow
173 decorationShown: false
169 decorationShown: false
170+ highlightShown: index == appRepeater.highlightedIndex
174 }
171 }
175 PropertyChanges {
172 PropertyChanges {
176 target: tileInfo
173 target: tileInfo
@@ -217,6 +214,7 @@ FocusScope {
217 anchors.fill: parent
214 anchors.fill: parent
218 application: ApplicationManager.get(index)
215 application: ApplicationManager.get(index)
219 active: ApplicationManager.focusedApplicationId === model.appId
216 active: ApplicationManager.focusedApplicationId === model.appId
217+ highlightScale: 1 / appDelegate.itemScale
220
218
221 onFocusChanged: {
219 onFocusChanged: {
222 if (focus) {
220 if (focus) {
@@ -241,12 +239,6 @@ FocusScope {
241 angle: appDelegate.angle
239 angle: appDelegate.angle
242 }
240 }
243 ]
241 ]
244− Rectangle {
245− id: darkenOverlay
246− anchors.fill: parent
247− color: "black"
248− opacity: 0
249− }
250 }
242 }
251
243
252
244