on xenial help sign in
update sleection highlight
af2788aMichael Zanetti
qml/Stage/DecoratedWindow.qml+11−9
@@ -42,7 +42,9 @@ FocusScope {
42 property bool showDecoration: true
42 property bool showDecoration: true
43 property bool animateDecoration: false
43 property bool animateDecoration: false
44 property bool showHighlight: false
44 property bool showHighlight: false
45+ property int highlightSize: units.gu(1)
45 property real shadowOpacity: 0
46 property real shadowOpacity: 0
47+ property bool darkening: false
46
48
47 property real requestedWidth
49 property real requestedWidth
48 property real requestedHeight
50 property real requestedHeight
@@ -82,16 +84,9 @@ FocusScope {
82 Rectangle {
84 Rectangle {
83 id: selectionHighlight
85 id: selectionHighlight
84 anchors.fill: parent
86 anchors.fill: parent
85− anchors.margins: -units.gu(1)
87+ anchors.margins: -root.highlightSize
86 color: "white"
88 color: "white"
87− opacity: showHighlight ? 0.15 : 0
89+ opacity: showHighlight ? 0.55 : 0
88− }
89−
90− Rectangle {
91− anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
92− height: units.dp(2)
93− color: theme.palette.normal.focus
94− visible: showHighlight
95 }
90 }
96
91
97 BorderImage {
92 BorderImage {
@@ -186,4 +181,11 @@ FocusScope {
186
181
187 ]
182 ]
188 }
183 }
184+
185+ Rectangle {
186+ anchors.fill: parent
187+ color: "black"
188+ opacity: root.darkening && !root.showHighlight ? 0.05 : 0
189+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
190+ }
189}
191}
qml/Stage/Spread/SpreadMaths.qml+11−3
@@ -35,6 +35,16 @@ Item {
35 property real stackingX: (MathUtils.easeOutCubic(rightStackingProgress) - MathUtils.easeOutCubic(leftStackingProgress)) * spread.stackWidth
35 property real stackingX: (MathUtils.easeOutCubic(rightStackingProgress) - MathUtils.easeOutCubic(leftStackingProgress)) * spread.stackWidth
36
36
37
37
38+ QtObject {
39+ id: d
40+ property real spreadScale: MathUtils.clamp(
41+ MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
42+ spread.leftStackScale, spread.rightStackScale)
43+
44+ property real selectedScale: (spread.highlightedIndex == itemIndex ? 1.01 : 1)
45+ Behavior on selectedScale { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
46+
47+ }
38
48
39 // Output
49 // Output
40 readonly property int targetX: spread.leftStackXPos +
50 readonly property int targetX: spread.leftStackXPos +
@@ -48,9 +58,7 @@ Item {
48 Math.min(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle), Math.max(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle))
58 Math.min(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle), Math.max(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle))
49
59
50
60
51− readonly property real targetScale: MathUtils.clamp(
61+ readonly property real targetScale: d.spreadScale * d.selectedScale
52− MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
53− spread.leftStackScale, spread.rightStackScale)
54
62
55 readonly property real shadowOpacity: 0.2 * (1 - rightStackingProgress) * (1 - leftStackingProgress)
63 readonly property real shadowOpacity: 0.2 * (1 - rightStackingProgress) * (1 - leftStackingProgress)
56
64
qml/Stage/Stage.qml+2
@@ -835,6 +835,7 @@ AbstractStage {
835 hasDecoration: root.mode === "windowed"
835 hasDecoration: root.mode === "windowed"
836 shadowOpacity: spreadMaths.shadowOpacity
836 shadowOpacity: spreadMaths.shadowOpacity
837 showHighlight: spreadItem.highlightedIndex === index
837 showHighlight: spreadItem.highlightedIndex === index
838+ darkening: spreadItem.highlightedIndex >= 0
838 anchors.topMargin: dragArea.distance
839 anchors.topMargin: dragArea.distance
839 }
840 }
840 PropertyChanges {
841 PropertyChanges {
@@ -1156,6 +1157,7 @@ AbstractStage {
1156 overlayShown: touchControls.overlayShown
1157 overlayShown: touchControls.overlayShown
1157 width: implicitWidth
1158 width: implicitWidth
1158 height: implicitHeight
1159 height: implicitHeight
1160+ highlightSize: windowInfoItem.iconMargin / 2
1159
1161
1160 requestedWidth: appDelegate.requestedWidth
1162 requestedWidth: appDelegate.requestedWidth
1161 requestedHeight: appDelegate.requestedHeight
1163 requestedHeight: appDelegate.requestedHeight