on xenial help sign in
opacity change on search hide
commit2449ea3d991c3d4628eacd8699b6def35097426e authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 7 Oct 2013, 11:15 (13 years ago) parentdb48541
4 files changed+32−28
Panel/IndicatorRow.qml+29−26 Panel/Indicators.qml+1 Panel/Panel.qml+1−1 Panel/SearchIndicator.qml+1−1
Panel/IndicatorRow.qml+29−26
@@ -28,6 +28,7 @@ Item {
2828 property QtObject indicatorsModel: null
2929 property var visibleIndicators: defined
3030 property int overFlowWidth: width
31+ property bool showAll: false
3132
3233 width: units.gu(40)
3334 height: units.gu(3)
@@ -43,6 +44,15 @@ Item {
4344 }
4445 }
4546
47+ Timer {
48+ id: allVisible
49+ interval: 1000
50+
51+ onTriggered: {
52+ showAll = false;
53+ }
54+ }
55+
4656 Row {
4757 id: row
4858
@@ -55,11 +65,21 @@ Item {
5565 objectName: "rowRepeater"
5666 model: indicatorsModel ? indicatorsModel : undefined
5767
68+ property int lastCount: 0
69+ onCountChanged: {
70+ if (lastCount < count) {
71+ showAll = true;
72+ allVisible.start();
73+ }
74+ lastCount = count;
75+ }
76+
5877 Item {
5978 id: itemWrapper
6079 height: indicatorRow.height
6180 width: indicatorItem.width
6281 visible: indicatorItem.indicatorVisible
82+ opacity: 1.0
6383 y: 0
6484 state: "standard"
6585
@@ -67,6 +87,9 @@ Item {
6787 property alias highlighted: indicatorItem.highlighted
6888 property alias dimmed: indicatorItem.dimmed
6989
90+ property bool hidden: !showAll && !indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")
91+ property bool overflow: row.width - itemWrapper.x > overFlowWidth
92+
7093 IndicatorItem {
7194 id: indicatorItem
7295 height: parent.height
@@ -93,44 +116,24 @@ Item {
93116 }
94117 }
95118
96− opacity: {
97− if (!indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) {
98− return 0.0;
99− } else {
100− return 1.0;
101− }
102− }
103− Behavior on opacity {
104− StandardAnimation {
105− // flow away from current index
106− duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
107− }
108− }
109119 states: [
110120 State {
111121 name: "standard"
112− when: row.width - itemWrapper.x <= overFlowWidth
113− PropertyChanges { target: itemWrapper; y: 0 }
122+ when: !hidden && !overflow
114123 },
115124 State {
116125 name: "overflow"
117− when: row.width - itemWrapper.x > overFlowWidth
118− PropertyChanges { target: itemWrapper; y: -indicatorRow.height }
126+ when: hidden || overflow
127+ PropertyChanges { target: itemWrapper; opacity: 0.0 }
119128 }
120129 ]
130+
121131 transitions: [
122132 Transition {
123− from: "standard"; to: "overflow"
124− StandardAnimation {
125− target: itemWrapper
126− property: "y"
127− }
128− },
129− Transition {
130− from: "overflow"; to: "standard"
131133 StandardAnimation {
132134 target: itemWrapper
133− property: "y"
135+ property: "opacity"
136+ duration: 300
134137 }
135138 }
136139 ]
Panel/Indicators.qml+1
@@ -29,6 +29,7 @@ Showable {
2929 property int panelHeight: units.gu(3)
3030 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
3131 property alias overFlowWidth: indicatorRow.overFlowWidth
32+ property alias showAll: indicatorRow.showAll
3233
3334 property int hintValue
3435 readonly property int lockThreshold: openedHeight / 2
Panel/Panel.qml+1−1
@@ -121,7 +121,7 @@ Item {
121121 return "hidden";
122122 }
123123 }
124− if (root.searchVisible) {
124+ if (root.searchVisible && !indicatorsMenu.showAll) {
125125 return "visible";
126126 }
127127
Panel/SearchIndicator.qml+1−1
@@ -46,7 +46,7 @@ Item {
4646 }
4747 spacing: units.gu(1)
4848
49− Behavior on opacity { StandardAnimation {} }
49+ Behavior on opacity { StandardAnimation { duration: 300 } }
5050
5151 Image {
5252 id: icon