width += items[x].width;
}
- var spacing = (tools.width - width - tools.menuWidth) / len;
+ var totalWidth = tools.width - width;
+ if (tools.hideBack) {
+ len -= 1;
+ } else {
+ totalWidth -= tools.menuWidth;
+ }
- for (var x = 0; x < len; x++) {
+ var spacing = totalWidth / len;
+
+ for (var x = 0; x < items.length; x++) {
var child = items[x];
if (x != 0) {
var prev = items[x - 1];
child.x = prev.x + prev.width + spacing;
- }
- else {
+ } else if (tools.hideBack) {
+ child.x = 0;
+ } else {
child.x = spacing + 80;
}
property int targetWidth: parent.width - (2 * anchors.leftMargin)
property alias menuWidth: menu.width
property bool manualBack: false
+ property bool hideBack: false
signal clicked
height: menu.height
ToolIcon {
property bool __isMenu: true
+ visible: !parent.hideBack
id: menu
anchors.verticalCenter: parent.verticalCenter
iconSource: "image://theme/icon-m-toolbar-back-white"