on xenial help sign in
opacity change on search hide
2449ea3Nick Dedekind
Panel/IndicatorRow.qml+29−26
@@ -28,6 +28,7 @@ Item {
28 property QtObject indicatorsModel: null
28 property QtObject indicatorsModel: null
29 property var visibleIndicators: defined
29 property var visibleIndicators: defined
30 property int overFlowWidth: width
30 property int overFlowWidth: width
31+ property bool showAll: false
31
32
32 width: units.gu(40)
33 width: units.gu(40)
33 height: units.gu(3)
34 height: units.gu(3)
@@ -43,6 +44,15 @@ Item {
43 }
44 }
44 }
45 }
45
46
47+ Timer {
48+ id: allVisible
49+ interval: 1000
50+
51+ onTriggered: {
52+ showAll = false;
53+ }
54+ }
55+
46 Row {
56 Row {
47 id: row
57 id: row
48
58
@@ -55,11 +65,21 @@ Item {
55 objectName: "rowRepeater"
65 objectName: "rowRepeater"
56 model: indicatorsModel ? indicatorsModel : undefined
66 model: indicatorsModel ? indicatorsModel : undefined
57
67
68+ property int lastCount: 0
69+ onCountChanged: {
70+ if (lastCount < count) {
71+ showAll = true;
72+ allVisible.start();
73+ }
74+ lastCount = count;
75+ }
76+
58 Item {
77 Item {
59 id: itemWrapper
78 id: itemWrapper
60 height: indicatorRow.height
79 height: indicatorRow.height
61 width: indicatorItem.width
80 width: indicatorItem.width
62 visible: indicatorItem.indicatorVisible
81 visible: indicatorItem.indicatorVisible
82+ opacity: 1.0
63 y: 0
83 y: 0
64 state: "standard"
84 state: "standard"
65
85
@@ -67,6 +87,9 @@ Item {
67 property alias highlighted: indicatorItem.highlighted
87 property alias highlighted: indicatorItem.highlighted
68 property alias dimmed: indicatorItem.dimmed
88 property alias dimmed: indicatorItem.dimmed
69
89
90+ property bool hidden: !showAll && !indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")
91+ property bool overflow: row.width - itemWrapper.x > overFlowWidth
92+
70 IndicatorItem {
93 IndicatorItem {
71 id: indicatorItem
94 id: indicatorItem
72 height: parent.height
95 height: parent.height
@@ -93,44 +116,24 @@ Item {
93 }
116 }
94 }
117 }
95
118
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− }
109 states: [
119 states: [
110 State {
120 State {
111 name: "standard"
121 name: "standard"
112− when: row.width - itemWrapper.x <= overFlowWidth
122+ when: !hidden && !overflow
113− PropertyChanges { target: itemWrapper; y: 0 }
114 },
123 },
115 State {
124 State {
116 name: "overflow"
125 name: "overflow"
117− when: row.width - itemWrapper.x > overFlowWidth
126+ when: hidden || overflow
118− PropertyChanges { target: itemWrapper; y: -indicatorRow.height }
127+ PropertyChanges { target: itemWrapper; opacity: 0.0 }
119 }
128 }
120 ]
129 ]
130+
121 transitions: [
131 transitions: [
122 Transition {
132 Transition {
123− from: "standard"; to: "overflow"
124− StandardAnimation {
125− target: itemWrapper
126− property: "y"
127− }
128− },
129− Transition {
130− from: "overflow"; to: "standard"
131 StandardAnimation {
133 StandardAnimation {
132 target: itemWrapper
134 target: itemWrapper
133− property: "y"
135+ property: "opacity"
136+ duration: 300
134 }
137 }
135 }
138 }
136 ]
139 ]
Panel/Indicators.qml+1
@@ -29,6 +29,7 @@ Showable {
29 property int panelHeight: units.gu(3)
29 property int panelHeight: units.gu(3)
30 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
30 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
31 property alias overFlowWidth: indicatorRow.overFlowWidth
31 property alias overFlowWidth: indicatorRow.overFlowWidth
32+ property alias showAll: indicatorRow.showAll
32
33
33 property int hintValue
34 property int hintValue
34 readonly property int lockThreshold: openedHeight / 2
35 readonly property int lockThreshold: openedHeight / 2
Panel/Panel.qml+1−1
@@ -121,7 +121,7 @@ Item {
121 return "hidden";
121 return "hidden";
122 }
122 }
123 }
123 }
124− if (root.searchVisible) {
124+ if (root.searchVisible && !indicatorsMenu.showAll) {
125 return "visible";
125 return "visible";
126 }
126 }
127
127
Panel/SearchIndicator.qml+1−1
@@ -46,7 +46,7 @@ Item {
46 }
46 }
47 spacing: units.gu(1)
47 spacing: units.gu(1)
48
48
49− Behavior on opacity { StandardAnimation {} }
49+ Behavior on opacity { StandardAnimation { duration: 300 } }
50
50
51 Image {
51 Image {
52 id: icon
52 id: icon