on xenial help sign in
appinfo item
17ebf89Michael Zanetti
qml/Stages/DesktopStage.qml+4−2
@@ -741,7 +741,7 @@ AbstractStage {
741 scaleToPreviewSize: spreadItem.stackHeight
741 scaleToPreviewSize: spreadItem.stackHeight
742 scaleToPreviewProgress: 1
742 scaleToPreviewProgress: 1
743 hasDecoration: root.mode === "windowed"
743 hasDecoration: root.mode === "windowed"
744− shadowOpacity: .3
744+ shadowOpacity: spreadMaths.shadowOpacity
745 }
745 }
746 PropertyChanges {
746 PropertyChanges {
747 target: appDelegate
747 target: appDelegate
@@ -751,9 +751,10 @@ AbstractStage {
751 height: spreadItem.spreadItemHeight
751 height: spreadItem.spreadItemHeight
752 requestedWidth: decoratedWindow.oldRequestedWidth
752 requestedWidth: decoratedWindow.oldRequestedWidth
753 requestedHeight: decoratedWindow.oldRequestedHeight
753 requestedHeight: decoratedWindow.oldRequestedHeight
754+ visible: spreadMaths.itemVisible
754 }
755 }
755 PropertyChanges { target: inputBlocker; enabled: true }
756 PropertyChanges { target: inputBlocker; enabled: true }
756− PropertyChanges { target: windowInfoItem; opacity: 1 }
757+ PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
757 },
758 },
758 State {
759 State {
759 name: "stagedrightedge";
760 name: "stagedrightedge";
@@ -1120,6 +1121,7 @@ AbstractStage {
1120 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(1) }
1121 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(1) }
1121 title: decoratedWindow.title
1122 title: decoratedWindow.title
1122 iconSource: model.application.icon
1123 iconSource: model.application.icon
1124+ height: spreadItem.appInfoHeight
1123 opacity: 0
1125 opacity: 0
1124 visible: opacity > 0
1126 visible: opacity > 0
1125 Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }
1127 Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }
qml/Stages/Spread/SpreadMaths.qml+12−3
@@ -53,10 +53,19 @@ Item {
53 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
53 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
54 spread.leftStackScale, spread.rightStackScale)
54 spread.leftStackScale, spread.rightStackScale)
55
55
56+ readonly property real shadowOpacity: 0.2 * (1 - rightStackingProgress) * (1 - leftStackingProgress)
57+
58+
56 readonly property real closeIconOffset: (scale - 1) * (-root.spreadHeight / 2)
59 readonly property real closeIconOffset: (scale - 1) * (-root.spreadHeight / 2)
57
60
58− readonly property real tileInfoOpacity: 1
61+ readonly property real tileInfoOpacity: Math.min(MathUtils.clamp(MathUtils.map(leftStackingProgress, 0 , 1/(spread.stackItemCount*3), 1, 0), 0 , 1),
62+ MathUtils.clamp(MathUtils.map(spreadPosition, 0.9 , 1, 1, 0), 0 , 1)) /** MathUtils.map(curvedSwitcherProgress, 0.7, 0.9, 0, 1)*/
63+
64+ readonly property bool itemVisible: {
65+ var leftStackHidden = spreadPosition < -(spread.stackItemCount + 1)/spread.visibleItemCount
66+ // don't hide the rightmost
67+ var rightStackHidden = (spreadPosition > 1 + (spread.stackItemCount)/spread.visibleItemCount) && itemIndex !== spread.totalItemCount - 1
68+ return !leftStackHidden && !rightStackHidden
69+ }
59
70
60− readonly property bool itemVisible: true
61− readonly property real shadowOpacity: 1
62}
71}
qml/Stages/WindowInfoItem.qml+27−5
@@ -1,18 +1,40 @@
1import QtQuick 2.4
1import QtQuick 2.4
2import Ubuntu.Components 1.3
2import Ubuntu.Components 1.3
3
3
4−Column {
4+Item {
5 id: root
5 id: root
6 property alias title: titleLabel.text
6 property alias title: titleLabel.text
7 property alias iconSource: icon.source
7 property alias iconSource: icon.source
8
8
9+ property real iconHeight: (height - titleLabel.height) * 0.65
10+ property real iconMargin: (height - titleLabel.height) * 0.25
11+ property real labelMargin: (height - titleLabel.height) * 0.1
9
12
13+ UbuntuShape {
14+ id: iconShape
15+ anchors {
16+ top: parent.top
17+ topMargin: iconMargin
18+ left: parent.left
19+ }
20+ width: units.gu(8) / units.gu(7.5) * height
21+ height: iconHeight
22+ borderSource: "undefined"
10− Image {
23+ source: Image {
11− id: icon
24+ id: icon
12− width: units.gu(5)
25+ sourceSize.width: iconShape.width
13− height: width
26+ sourceSize.height: iconShape.height
27+ }
14 }
28 }
29+
15 Label {
30 Label {
16 id: titleLabel
31 id: titleLabel
32+ anchors {
33+ left: iconShape.left
34+ top: iconShape.bottom
35+ topMargin: labelMargin
36+ }
37+ fontSize: 'small'
38+ color: 'white'
17 }
39 }
18}
40}