on xenial help sign in
Remove unclickable gaps on the menubar (LP: #1672722)

Approved by: Daniel d'Andrada, Unity8 CI Bot

commitb1b726e23ba776eb6422628da69652c59d0af6c3 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 28 Mar 2017, 21:44 (10 years ago) parent21080b977b2d9a
1 file changed+12−6
qml/ApplicationMenus/MenuBar.qml+12−6
qml/ApplicationMenus/MenuBar.qml+12−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2016 Canonical Ltd.
2+ * Copyright 2016, 2017 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -90,7 +90,7 @@ Item {
9090
9191 Row {
9292 id: row
93− spacing: units.gu(2)
93+ spacing: 0
9494 height: parent.height
9595
9696 ActionContext {
@@ -125,7 +125,11 @@ Item {
125125 readonly property bool shouldDisplay: x + width + ((__ownIndex < rowRepeater.count-1) ? units.gu(2) : 0) <
126126 root.overflowWidth - ((__ownIndex < rowRepeater.count-1) ? overflowButton.width : 0)
127127
128− implicitWidth: column.implicitWidth
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+
132+ implicitWidth: column.implicitWidth + (isFirstItem ? units.gu(1) : units.gu(2))
129133 implicitHeight: row.height
130134 enabled: (model.sensitive === true) && shouldDisplay
131135 opacity: shouldDisplay ? 1 : 0
@@ -189,7 +193,9 @@ Item {
189193 id: column
190194 spacing: units.gu(1)
191195 anchors {
192− centerIn: parent
196+ verticalCenter: parent.verticalCenter
197+ horizontalCenter: !visualItem.isFirstItem ? parent.horizontalCenter : undefined
198+ left: visualItem.isFirstItem ? parent.left : undefined
193199 }
194200
195201 Icon {
@@ -385,8 +391,8 @@ Item {
385391 anchors {
386392 bottom: row.bottom
387393 }
388− x: d.currentItem ? row.x + d.currentItem.x - units.gu(1) : 0
389− width: d.currentItem ? d.currentItem.width + units.gu(2) : 0
394+ x: d.currentItem ? row.x + d.currentItem.x : 0
395+ width: d.currentItem ? d.currentItem.width : 0
390396 height: units.dp(4)
391397 color: UbuntuColors.orange
392398 visible: d.currentItem