on xenial help sign in
Improve Launcher ←→ touch menu interaction
bdc4f80Albert Astals Cid
qml/Panel/Panel.qml+2
@@ -41,6 +41,7 @@ Item {
41 property real expandedPanelHeight: units.gu(7)
41 property real expandedPanelHeight: units.gu(7)
42 property real indicatorMenuWidth: width
42 property real indicatorMenuWidth: width
43 property real applicationMenuWidth: width
43 property real applicationMenuWidth: width
44+ property alias applicationMenuContentX: __applicationMenus.menuContentX
44
45
45 property alias applicationMenus: __applicationMenus
46 property alias applicationMenus: __applicationMenus
46 property alias indicators: __indicators
47 property alias indicators: __indicators
@@ -250,6 +251,7 @@ Item {
250 PanelMenu {
251 PanelMenu {
251 id: __applicationMenus
252 id: __applicationMenus
252
253
254+ x: root.applicationMenuContentX
253 model: registeredMenuModel.model
255 model: registeredMenuModel.model
254 width: root.applicationMenuWidth
256 width: root.applicationMenuWidth
255 minimizedPanelHeight: root.minimizedPanelHeight
257 minimizedPanelHeight: root.minimizedPanelHeight
qml/Panel/PanelBar.qml+1
@@ -32,6 +32,7 @@ Item {
32
32
33 property alias showRowTitle: row.showRowTitle
33 property alias showRowTitle: row.showRowTitle
34 property alias rowTitle: row.rowTitle
34 property alias rowTitle: row.rowTitle
35+ property alias shiftLeftTitle: row.shiftLeftTitle
35 property alias rowItemDelegate: row.delegate
36 property alias rowItemDelegate: row.delegate
36
37
37 implicitWidth: flickable.contentWidth
38 implicitWidth: flickable.contentWidth
qml/Panel/PanelItemRow.qml+2−1
@@ -25,6 +25,7 @@ Item {
25
25
26 property bool showRowTitle: false
26 property bool showRowTitle: false
27 property alias rowTitle: rowLabel.text
27 property alias rowTitle: rowLabel.text
28+ property real shiftLeftTitle: 0
28 property QtObject model: null
29 property QtObject model: null
29 property real overFlowWidth: width
30 property real overFlowWidth: width
30 property bool expanded: false
31 property bool expanded: false
@@ -143,7 +144,7 @@ Item {
143 objectName: "panelTitle"
144 objectName: "panelTitle"
144 anchors {
145 anchors {
145 left: parent.left
146 left: parent.left
146− leftMargin: units.gu(1)
147+ leftMargin: units.gu(1) - root.shiftLeftTitle
147 verticalCenter: parent.verticalCenter
148 verticalCenter: parent.verticalCenter
148 }
149 }
149 width: implicitWidth + units.gu(2)
150 width: implicitWidth + units.gu(2)
qml/Panel/PanelMenu.qml+31−19
@@ -33,6 +33,7 @@ Showable {
33 property bool enableHint: true
33 property bool enableHint: true
34 property bool showOnClick: true
34 property bool showOnClick: true
35 property color panelColor: theme.palette.normal.background
35 property color panelColor: theme.palette.normal.background
36+ property real menuContentX: 0
36
37
37 property alias alignment: bar.alignment
38 property alias alignment: bar.alignment
38 property alias rowTitle: bar.rowTitle
39 property alias rowTitle: bar.rowTitle
@@ -77,33 +78,42 @@ Showable {
77
78
78 shown: false
79 shown: false
79 height: minimizedPanelHeight
80 height: minimizedPanelHeight
80− clip: root.partiallyOpened
81
81
82 onUnitProgressChanged: d.updateState()
82 onUnitProgressChanged: d.updateState()
83
83
84− // eater
84+ Item {
85− MouseArea {
86− anchors.fill: content
87− hoverEnabled: true
88− acceptedButtons: Qt.AllButtons
89− onWheel: wheel.accepted = true;
90− enabled: root.state != "initial"
91− visible: content.visible
92− }
93−
94− MenuContent {
95− id: content
96− objectName: "menuContent"
97−
98 anchors {
85 anchors {
99 left: parent.left
86 left: parent.left
100 right: parent.right
87 right: parent.right
101 top: bar.bottom
88 top: bar.bottom
89+ bottom: parent.bottom
90+ }
91+ clip: root.partiallyOpened
92+
93+ // eater
94+ MouseArea {
95+ anchors.fill: content
96+ hoverEnabled: true
97+ acceptedButtons: Qt.AllButtons
98+ onWheel: wheel.accepted = true;
99+ enabled: root.state != "initial"
100+ visible: content.visible
101+ }
102+
103+ MenuContent {
104+ id: content
105+ objectName: "menuContent"
106+
107+ anchors {
108+ left: parent.left
109+ right: parent.right
110+ top: parent.top
111+ }
112+ height: openedHeight - bar.height - handle.height
113+ model: root.model
114+ visible: root.unitProgress > 0
115+ currentMenuIndex: bar.currentItemIndex
102 }
116 }
103− height: openedHeight - bar.height - handle.height
104− model: root.model
105− visible: root.unitProgress > 0
106− currentMenuIndex: bar.currentItemIndex
107 }
117 }
108
118
109 Handle {
119 Handle {
@@ -165,6 +175,7 @@ Showable {
165 enableLateralChanges: false
175 enableLateralChanges: false
166 lateralPosition: -1
176 lateralPosition: -1
167 unitProgress: root.unitProgress
177 unitProgress: root.unitProgress
178+ shiftLeftTitle: root.menuContentX
168
179
169 height: expanded ? expandedPanelHeight : minimizedPanelHeight
180 height: expanded ? expandedPanelHeight : minimizedPanelHeight
170 Behavior on height { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing } }
181 Behavior on height { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing } }
@@ -217,6 +228,7 @@ Showable {
217 objectName: "showDragHandle"
228 objectName: "showDragHandle"
218 anchors.bottom: parent.bottom
229 anchors.bottom: parent.bottom
219 anchors.left: alignment == Qt.AlignLeft ? parent.left : undefined
230 anchors.left: alignment == Qt.AlignLeft ? parent.left : undefined
231+ anchors.leftMargin: -root.menuContentX
220 anchors.right: alignment == Qt.AlignRight ? parent.right : undefined
232 anchors.right: alignment == Qt.AlignRight ? parent.right : undefined
221 width: root.barWidth // show handle should only cover panel items.
233 width: root.barWidth // show handle should only cover panel items.
222 height: minimizedPanelHeight
234 height: minimizedPanelHeight
qml/Shell.qml+7−1
@@ -499,6 +499,11 @@ StyledItem {
499 expandedPanelHeight: units.gu(7)
499 expandedPanelHeight: units.gu(7)
500 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
500 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
501 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
501 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
502+ applicationMenuContentX: {
503+ if (launcher.shown) return launcher.panelWidth;
504+ else if (!applicationMenus.fullyClosed) return applicationMenus.x;
505+ else return 0;
506+ }
502
507
503 indicators {
508 indicators {
504 hides: [launcher]
509 hides: [launcher]
@@ -565,7 +570,8 @@ StyledItem {
565 }
570 }
566 onShownChanged: {
571 onShownChanged: {
567 if (shown) {
572 if (shown) {
568− panel.indicators.hide()
573+ panel.indicators.hide();
574+ panel.applicationMenus.hide();
569 }
575 }
570 }
576 }
571 onFocusChanged: {
577 onFocusChanged: {