on xenial help sign in
Make sure overflow indicators are hidden and not the search label.

Approved by Mirco Müller, PS Jenkins Bot.

commitdf672615e5654a4f716c77f1254212e6ffee5501 authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 9 Oct 2013, 18:36 (13 years ago) parente4ef5aafd16757
4 files changed+64−22
Panel/IndicatorRow.qml+51−12 Panel/Indicators.qml+2 Panel/Panel.qml+2−2 Panel/SearchIndicator.qml+9−8
Panel/IndicatorRow.qml+51−12
@@ -27,6 +27,8 @@ Item {
2727 property alias row: row
2828 property QtObject indicatorsModel: null
2929 property var visibleIndicators: defined
30+ property int overFlowWidth: width
31+ property bool showAll: false
3032
3133 width: units.gu(40)
3234 height: units.gu(3)
@@ -42,6 +44,15 @@ Item {
4244 }
4345 }
4446
47+ Timer {
48+ id: allVisible
49+ interval: 1000
50+
51+ onTriggered: {
52+ showAll = false;
53+ }
54+ }
55+
4556 Row {
4657 id: row
4758
@@ -54,16 +65,31 @@ Item {
5465 objectName: "rowRepeater"
5566 model: indicatorsModel ? indicatorsModel : undefined
5667
68+ property int lastCount: 0
69+ onCountChanged: {
70+ if (lastCount < count) {
71+ showAll = true;
72+ allVisible.start();
73+ }
74+ lastCount = count;
75+ }
76+
5777 Item {
5878 id: itemWrapper
5979 height: indicatorRow.height
6080 width: indicatorItem.width
6181 visible: indicatorItem.indicatorVisible
82+ opacity: 1.0
83+ y: 0
84+ state: "standard"
6285
6386 property int ownIndex: index
6487 property alias highlighted: indicatorItem.highlighted
6588 property alias dimmed: indicatorItem.dimmed
6689
90+ property bool hidden: !showAll && !indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")
91+ property bool overflow: row.width - itemWrapper.x > overFlowWidth
92+
6793 IndicatorItem {
6894 id: indicatorItem
6995 height: parent.height
@@ -87,22 +113,35 @@ Item {
87113 }
88114 indicatorRow.visibleIndicators[model.identifier] = indicatorVisible;
89115 indicatorRow.visibleIndicatorsChanged();
116+
117+ if (indicatorVisible) {
118+ showAll = true;
119+ allVisible.start();
120+ }
90121 }
91122 }
92123
93− opacity: {
94− if (!indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) {
95− return 0.0;
96− } else {
97− return 1.0;
124+ states: [
125+ State {
126+ name: "standard"
127+ when: !hidden && !overflow
128+ },
129+ State {
130+ name: "overflow"
131+ when: hidden || overflow
132+ PropertyChanges { target: itemWrapper; opacity: 0.0 }
98133 }
99− }
100− Behavior on opacity {
101− StandardAnimation {
102− // flow away from current index
103− duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
104− }
105− }
134+ ]
135+
136+ transitions: [
137+ Transition {
138+ StandardAnimation {
139+ target: itemWrapper
140+ property: "opacity"
141+ duration: 300
142+ }
143+ }
144+ ]
106145 }
107146 }
108147 }
Panel/Indicators.qml+2
@@ -29,6 +29,8 @@ Showable {
2929 property real openedHeight: units.gu(71)
3030 property int panelHeight: units.gu(3)
3131 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
32+ property alias overFlowWidth: indicatorRow.overFlowWidth
33+ property alias showAll: indicatorRow.showAll
3234
3335 property int hintValue
3436 readonly property int lockThreshold: openedHeight / 2
Panel/Panel.qml+2−2
@@ -83,6 +83,7 @@ Item {
8383 panelHeight: __panelMinusSeparatorLineHeight
8484 openedHeight: parent.height + (pinnedMode ? 0 : root.panelHeight)
8585 pinnedMode: !fullscreenMode
86+ overFlowWidth: search.state=="hidden" ? parent.width : parent.width - search.width
8687
8788 property real unitProgress: (height - panelHeight) / (openedHeight - panelHeight)
8889 }
@@ -121,14 +122,13 @@ Item {
121122 return "hidden";
122123 }
123124 }
124− if (root.searchVisible) {
125+ if (root.searchVisible && !indicatorsMenu.showAll) {
125126 return "visible";
126127 }
127128
128129 return "hidden";
129130 }
130131
131− width: units.gu(13)
132132 height: __panelMinusSeparatorLineHeight
133133 anchors {
134134 top: panelBackground.top
Panel/SearchIndicator.qml+9−8
@@ -21,7 +21,7 @@ import "../Components"
2121Item {
2222 id: search
2323
24− width: units.gu(9)
24+ width: container.width + units.gu(2)
2525 height: units.gu(3)
2626
2727 property string headerText: i18n.tr("Search")
@@ -34,21 +34,24 @@ Item {
3434 onClicked: search.clicked()
3535 }
3636
37− Item {
37+ Row {
3838 id: container
3939 objectName: "container"
4040
41− width: parent.width
4241 height: parent.height
42+ width: childrenRect.width
43+ anchors {
44+ left: parent.left
45+ leftMargin: units.gu(1)
46+ }
47+ spacing: units.gu(1)
4348
44− Behavior on opacity { StandardAnimation {} }
49+ Behavior on opacity { StandardAnimation { duration: 300 } }
4550
4651 Image {
4752 id: icon
4853 source: "graphics/search.png"
4954 anchors.verticalCenter: parent.verticalCenter
50− anchors.left: parent.left
51− anchors.leftMargin: units.gu(1)
5255 }
5356
5457 Label {
@@ -56,8 +59,6 @@ Item {
5659 color: Qt.rgba(0.8, 0.8, 0.8, 1.0)
5760 fontSize: "small"
5861 font.capitalization: Font.AllUppercase
59− anchors.left: icon.right
60− anchors.leftMargin: units.gu(1)
6162 anchors.verticalCenter: parent.verticalCenter
6263 }
6364 }