on xenial help sign in
appinfo item
commit17ebf89eff6cdaef75d57fc736751024b62a37e6 authorMichael Zanetti <michael.zanetti@canonical.com> dateSat 16 Jul 2016, 02:31 (10 years ago) parentabdb078
3 files changed+43−10
qml/Stages/DesktopStage.qml+4−2 qml/Stages/Spread/SpreadMaths.qml+12−3 qml/Stages/WindowInfoItem.qml+27−5
qml/Stages/DesktopStage.qml+4−2
@@ -741,7 +741,7 @@ AbstractStage {
741741 scaleToPreviewSize: spreadItem.stackHeight
742742 scaleToPreviewProgress: 1
743743 hasDecoration: root.mode === "windowed"
744− shadowOpacity: .3
744+ shadowOpacity: spreadMaths.shadowOpacity
745745 }
746746 PropertyChanges {
747747 target: appDelegate
@@ -751,9 +751,10 @@ AbstractStage {
751751 height: spreadItem.spreadItemHeight
752752 requestedWidth: decoratedWindow.oldRequestedWidth
753753 requestedHeight: decoratedWindow.oldRequestedHeight
754+ visible: spreadMaths.itemVisible
754755 }
755756 PropertyChanges { target: inputBlocker; enabled: true }
756− PropertyChanges { target: windowInfoItem; opacity: 1 }
757+ PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
757758 },
758759 State {
759760 name: "stagedrightedge";
@@ -1120,6 +1121,7 @@ AbstractStage {
11201121 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(1) }
11211122 title: decoratedWindow.title
11221123 iconSource: model.application.icon
1124+ height: spreadItem.appInfoHeight
11231125 opacity: 0
11241126 visible: opacity > 0
11251127 Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }
qml/Stages/Spread/SpreadMaths.qml+12−3
@@ -53,10 +53,19 @@ Item {
5353 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
5454 spread.leftStackScale, spread.rightStackScale)
5555
56+ readonly property real shadowOpacity: 0.2 * (1 - rightStackingProgress) * (1 - leftStackingProgress)
57+
58+
5659 readonly property real closeIconOffset: (scale - 1) * (-root.spreadHeight / 2)
5760
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+ }
5970
60− readonly property bool itemVisible: true
61− readonly property real shadowOpacity: 1
6271}
qml/Stages/WindowInfoItem.qml+27−5
@@ -1,18 +1,40 @@
11import QtQuick 2.4
22import Ubuntu.Components 1.3
33
4−Column {
4+Item {
55 id: root
66 property alias title: titleLabel.text
77 property alias iconSource: icon.source
88
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
912
10− Image {
11− id: icon
12− width: units.gu(5)
13− height: width
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"
23+ source: Image {
24+ id: icon
25+ sourceSize.width: iconShape.width
26+ sourceSize.height: iconShape.height
27+ }
1428 }
29+
1530 Label {
1631 id: titleLabel
32+ anchors {
33+ left: iconShape.left
34+ top: iconShape.bottom
35+ topMargin: labelMargin
36+ }
37+ fontSize: 'small'
38+ color: 'white'
1739 }
1840}