on xenial help sign in
flow up
commitdb48541b8695d333c4eb20f04a3c864fc9f533f6 authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 2 Oct 2013, 12:25 (13 years ago) parent75c0909
3 files changed+33−27
Panel/IndicatorRow.qml+31 Panel/Indicators.qml+1 Panel/Panel.qml+1−27
Panel/IndicatorRow.qml+31
@@ -27,6 +27,7 @@ Item {
2727 property alias row: row
2828 property QtObject indicatorsModel: null
2929 property var visibleIndicators: defined
30+ property int overFlowWidth: width
3031
3132 width: units.gu(40)
3233 height: units.gu(3)
@@ -59,6 +60,8 @@ Item {
5960 height: indicatorRow.height
6061 width: indicatorItem.width
6162 visible: indicatorItem.indicatorVisible
63+ y: 0
64+ state: "standard"
6265
6366 property int ownIndex: index
6467 property alias highlighted: indicatorItem.highlighted
@@ -103,6 +106,34 @@ Item {
103106 duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
104107 }
105108 }
109+ states: [
110+ State {
111+ name: "standard"
112+ when: row.width - itemWrapper.x <= overFlowWidth
113+ PropertyChanges { target: itemWrapper; y: 0 }
114+ },
115+ State {
116+ name: "overflow"
117+ when: row.width - itemWrapper.x > overFlowWidth
118+ PropertyChanges { target: itemWrapper; y: -indicatorRow.height }
119+ }
120+ ]
121+ transitions: [
122+ 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 {
132+ target: itemWrapper
133+ property: "y"
134+ }
135+ }
136+ ]
106137 }
107138 }
108139 }
Panel/Indicators.qml+1
@@ -28,6 +28,7 @@ Showable {
2828 property real openedHeight: units.gu(71)
2929 property int panelHeight: units.gu(3)
3030 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
31+ property alias overFlowWidth: indicatorRow.overFlowWidth
3132
3233 property int hintValue
3334 readonly property int lockThreshold: openedHeight / 2
Panel/Panel.qml+1−27
@@ -82,6 +82,7 @@ Item {
8282 panelHeight: __panelMinusSeparatorLineHeight
8383 openedHeight: parent.height + (pinnedMode ? 0 : root.panelHeight)
8484 pinnedMode: !fullscreenMode
85+ overFlowWidth: search.state=="hidden" ? parent.width : parent.width - search.width
8586
8687 property real unitProgress: (height - panelHeight) / (openedHeight - panelHeight)
8788 }
@@ -109,33 +110,6 @@ Item {
109110 source: "graphics/rectangular_dropshadow.sci"
110111 }
111112
112− PanelBackground {
113− id: backgroundSearch
114− height: __panelMinusSeparatorLineHeight
115− y: panelBackground.y
116− anchors {
117− left: parent.left
118− right: search.right
119− }
120− clip: false
121− opacity: search.state=="visible" ? 1.0 : 0.0
122−
123− Rectangle {
124− id: backgroundGradient
125− anchors {
126− left: parent.right
127− }
128− width: __panelMinusSeparatorLineHeight
129− height: __panelMinusSeparatorLineHeight
130− rotation: 90
131− gradient: Gradient {
132− GradientStop { position: 0.0; color: "transparent" }
133− GradientStop { position: 1.0; color: backgroundSearch.color }
134− }
135− }
136− Behavior on opacity { StandardAnimation {} }
137− }
138−
139113 SearchIndicator {
140114 id: search
141115 objectName: "search"