on xenial help sign in
Remove unclickable gaps on the menubar
20f213eAlbert Astals Cid
qml/ApplicationMenus/MenuBar.qml+11−5
@@ -90,7 +90,7 @@ Item {
90
90
91 Row {
91 Row {
92 id: row
92 id: row
93− spacing: units.gu(2)
93+ spacing: 0
94 height: parent.height
94 height: parent.height
95
95
96 ActionContext {
96 ActionContext {
@@ -125,7 +125,11 @@ Item {
125 readonly property bool shouldDisplay: x + width + ((__ownIndex < rowRepeater.count-1) ? units.gu(2) : 0) <
125 readonly property bool shouldDisplay: x + width + ((__ownIndex < rowRepeater.count-1) ? units.gu(2) : 0) <
126 root.overflowWidth - ((__ownIndex < rowRepeater.count-1) ? overflowButton.width : 0)
126 root.overflowWidth - ((__ownIndex < rowRepeater.count-1) ? overflowButton.width : 0)
127
127
128+ // First item is not centered, it has 0 gu on the left and 1 on the right
129+ // so needs different width and anchors
130+ readonly property bool isFirstItem: __ownIndex == 0
131+
128− implicitWidth: column.implicitWidth
132+ implicitWidth: column.implicitWidth + (isFirstItem ? units.gu(1) : units.gu(2))
129 implicitHeight: row.height
133 implicitHeight: row.height
130 enabled: (model.sensitive === true) && shouldDisplay
134 enabled: (model.sensitive === true) && shouldDisplay
131 opacity: shouldDisplay ? 1 : 0
135 opacity: shouldDisplay ? 1 : 0
@@ -186,7 +190,9 @@ Item {
186 id: column
190 id: column
187 spacing: units.gu(1)
191 spacing: units.gu(1)
188 anchors {
192 anchors {
189− centerIn: parent
193+ verticalCenter: parent.verticalCenter
194+ horizontalCenter: !visualItem.isFirstItem ? parent.horizontalCenter : undefined
195+ left: visualItem.isFirstItem ? parent.left : undefined
190 }
196 }
191
197
192 Icon {
198 Icon {
@@ -381,8 +387,8 @@ Item {
381 anchors {
387 anchors {
382 bottom: row.bottom
388 bottom: row.bottom
383 }
389 }
384− x: d.currentItem ? row.x + d.currentItem.x - units.gu(1) : 0
390+ x: d.currentItem ? row.x + d.currentItem.x : 0
385− width: d.currentItem ? d.currentItem.width + units.gu(2) : 0
391+ width: d.currentItem ? d.currentItem.width : 0
386 height: units.dp(4)
392 height: units.dp(4)
387 color: UbuntuColors.orange
393 color: UbuntuColors.orange
388 visible: d.currentItem
394 visible: d.currentItem