on xenial help sign in
Move the Panel "title" from PanelItemRow to Panel
d977cf6Albert Astals Cid
qml/Panel/Panel.qml+24−2
@@ -260,6 +260,7 @@ Item {
260 alignment: Qt.AlignLeft
260 alignment: Qt.AlignLeft
261 enableHint: !callHint.active && !fullscreenMode
261 enableHint: !callHint.active && !fullscreenMode
262 showOnClick: false
262 showOnClick: false
263+ adjustDragHandleSizeToContents: false
263 panelColor: panelAreaBackground.color
264 panelColor: panelAreaBackground.color
264
265
265 onShowTapped: {
266 onShowTapped: {
@@ -268,8 +269,7 @@ Item {
268 }
269 }
269 }
270 }
270
271
271− showRowTitle: !expanded
272+ hideRow: !expanded
272− rowTitle: PanelState.title
273 rowItemDelegate: ActionItem {
273 rowItemDelegate: ActionItem {
274 id: actionItem
274 id: actionItem
275 property int ownIndex: index
275 property int ownIndex: index
@@ -310,6 +310,28 @@ Item {
310 }
310 }
311 }
311 }
312
312
313+ Label {
314+ id: rowLabel
315+ objectName: "panelTitle"
316+ anchors {
317+ left: parent.left
318+ leftMargin: units.gu(1)
319+ right: __indicators.left
320+ rightMargin: units.gu(1)
321+ }
322+ height: root.minimizedPanelHeight
323+ verticalAlignment: Text.AlignVCenter
324+ elide: Text.ElideRight
325+ maximumLineCount: 1
326+ fontSize: "medium"
327+ font.weight: Font.Medium
328+ color: Theme.palette.selected.backgroundText
329+ opacity: __applicationMenus.visible && !__applicationMenus.expanded ? 1 : 0
330+ visible: opacity != 0
331+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
332+ text: PanelState.title
333+ }
334+
313 PanelMenu {
335 PanelMenu {
314 id: __indicators
336 id: __indicators
315 objectName: "indicators"
337 objectName: "indicators"
qml/Panel/PanelBar.qml+1−3
@@ -30,9 +30,7 @@ Item {
30 property real lateralPosition: -1
30 property real lateralPosition: -1
31 property int alignment: Qt.AlignRight
31 property int alignment: Qt.AlignRight
32
32
33− property alias showRowTitle: row.showRowTitle
33+ property alias hideRow: row.hideRow
34− property alias rowTitle: row.rowTitle
35− property alias shiftLeftTitle: row.shiftLeftTitle
36 property alias rowItemDelegate: row.delegate
34 property alias rowItemDelegate: row.delegate
37
35
38 implicitWidth: flickable.contentWidth
36 implicitWidth: flickable.contentWidth
qml/Panel/PanelItemRow.qml+3−24
@@ -20,12 +20,10 @@ import "../Components"
20
20
21Item {
21Item {
22 id: root
22 id: root
23− implicitWidth: showRowTitle && !expanded ? rowTitle != "" ? rowLabel.width : 0 : row.width
23+ implicitWidth: row.width
24 implicitHeight: units.gu(3)
24 implicitHeight: units.gu(3)
25
25
26− property bool showRowTitle: false
26+ property bool hideRow: false
27− property alias rowTitle: rowLabel.text
28− property real shiftLeftTitle: 0
29 property QtObject model: null
27 property QtObject model: null
30 property real overFlowWidth: width
28 property real overFlowWidth: width
31 property bool expanded: false
29 property bool expanded: false
@@ -139,31 +137,12 @@ Item {
139 d.previousItem = currentItem;
137 d.previousItem = currentItem;
140 }
138 }
141
139
142− Label {
143− id: rowLabel
144− objectName: "panelTitle"
145− anchors {
146− left: parent.left
147− leftMargin: units.gu(1) - root.shiftLeftTitle
148− verticalCenter: parent.verticalCenter
149− }
150− width: implicitWidth + units.gu(2)
151− elide: Text.ElideRight
152− maximumLineCount: 1
153− fontSize: "medium"
154− font.weight: Font.Medium
155− color: Theme.palette.selected.backgroundText
156− opacity: showRowTitle ? 1 : 0
157− visible: opacity != 0
158− Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
159− }
160−
161 ListView {
140 ListView {
162 id: row
141 id: row
163 objectName: "panelRow"
142 objectName: "panelRow"
164 orientation: ListView.Horizontal
143 orientation: ListView.Horizontal
165 model: root.model
144 model: root.model
166− opacity: showRowTitle ? 0 : 1
145+ opacity: hideRow ? 0 : 1
167 // dont set visible on basis of opacity; otherwise width will not be calculated correctly
146 // dont set visible on basis of opacity; otherwise width will not be calculated correctly
168 anchors {
147 anchors {
169 top: parent.top
148 top: parent.top
qml/Panel/PanelMenu.qml+4−5
@@ -32,12 +32,12 @@ Showable {
32 property real openedHeight: units.gu(71)
32 property real openedHeight: units.gu(71)
33 property bool enableHint: true
33 property bool enableHint: true
34 property bool showOnClick: true
34 property bool showOnClick: true
35+ property bool adjustDragHandleSizeToContents: true
35 property color panelColor: theme.palette.normal.background
36 property color panelColor: theme.palette.normal.background
36 property real menuContentX: 0
37 property real menuContentX: 0
37
38
38 property alias alignment: bar.alignment
39 property alias alignment: bar.alignment
39− property alias rowTitle: bar.rowTitle
40+ property alias hideRow: bar.hideRow
40− property alias showRowTitle: bar.showRowTitle
41 property alias rowItemDelegate: bar.rowItemDelegate
41 property alias rowItemDelegate: bar.rowItemDelegate
42 property alias pageDelegate: content.pageDelegate
42 property alias pageDelegate: content.pageDelegate
43
43
@@ -46,7 +46,7 @@ Showable {
46 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
46 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
47 readonly property bool fullyClosed: unitProgress == 0
47 readonly property bool fullyClosed: unitProgress == 0
48 readonly property alias expanded: bar.expanded
48 readonly property alias expanded: bar.expanded
49− readonly property int barWidth: Math.min(bar.width, bar.implicitWidth)
49+ readonly property int barWidth: adjustDragHandleSizeToContents ? Math.min(bar.width, bar.implicitWidth) : bar.width
50
50
51 signal showTapped()
51 signal showTapped()
52
52
@@ -175,7 +175,6 @@ Showable {
175 enableLateralChanges: false
175 enableLateralChanges: false
176 lateralPosition: -1
176 lateralPosition: -1
177 unitProgress: root.unitProgress
177 unitProgress: root.unitProgress
178− shiftLeftTitle: root.menuContentX
179
178
180 height: expanded ? expandedPanelHeight : minimizedPanelHeight
179 height: expanded ? expandedPanelHeight : minimizedPanelHeight
181 Behavior on height { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing } }
180 Behavior on height { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing } }
@@ -230,7 +229,7 @@ Showable {
230 anchors.left: alignment == Qt.AlignLeft ? parent.left : undefined
229 anchors.left: alignment == Qt.AlignLeft ? parent.left : undefined
231 anchors.leftMargin: -root.menuContentX
230 anchors.leftMargin: -root.menuContentX
232 anchors.right: alignment == Qt.AlignRight ? parent.right : undefined
231 anchors.right: alignment == Qt.AlignRight ? parent.right : undefined
233− width: root.barWidth // show handle should only cover panel items.
232+ width: root.barWidth + root.menuContentX // show handle should only cover panel items.
234 height: minimizedPanelHeight
233 height: minimizedPanelHeight
235 direction: Direction.Downwards
234 direction: Direction.Downwards
236 enabled: !root.shown && root.available
235 enabled: !root.shown && root.available