Changeset View
Changeset View
Standalone View
Standalone View
src/controls/ActionToolBar.qml
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 142 | Item { | |||
---|---|---|---|---|---|
143 | Layout.fillWidth: root.alignment == Qt.AlignLeft || root.alignment == Qt.AlignHCenter || root.alignment == Qt.AlignCenter; | 143 | Layout.fillWidth: root.alignment == Qt.AlignLeft || root.alignment == Qt.AlignHCenter || root.alignment == Qt.AlignCenter; | ||
144 | Layout.fillHeight: true | 144 | Layout.fillHeight: true | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | PrivateActionToolButton { | 147 | PrivateActionToolButton { | ||
148 | id: moreButton | 148 | id: moreButton | ||
149 | 149 | | |||
150 | Layout.alignment: Qt.AlignRight | 150 | Layout.alignment: Qt.AlignRight | ||
151 | visible: root.hiddenActions.length > 0 || details.hiddenActions.length > 0 | 151 | visible: { | ||
152 | // Only show the overflow button when we actually have visible actions in the menu, | ||||
153 | // otherwise we end up showing an overflow button that shows nothing. | ||||
154 | var visibleCount = Array.prototype.reduce.call(kirigamiAction.children, function (total, current) { | ||||
155 | return (details.visibleActions.indexOf(current) == -1 && (current.visible === undefined || current.visible)) ? total + 1 : total | ||||
156 | }, 0); | ||||
157 | return visibleCount > 0 | ||||
158 | } | ||||
152 | 159 | | |||
153 | kirigamiAction: Kirigami.Action { | 160 | kirigamiAction: Kirigami.Action { | ||
154 | icon.name: "overflow-menu" | 161 | icon.name: "overflow-menu" | ||
155 | displayHint: Kirigami.Action.DisplayHint.IconOnly | Kirigami.Action.DisplayHint.HideChildIndicator | 162 | displayHint: Kirigami.Action.DisplayHint.IconOnly | Kirigami.Action.DisplayHint.HideChildIndicator | ||
156 | children: Array.prototype.map.call(root.actions, function (i) { return i }).concat(Array.prototype.map.call(hiddenActions, function (i) { return i })) | 163 | children: Array.prototype.map.call(root.actions, function (i) { return i }).concat(Array.prototype.map.call(hiddenActions, function (i) { return i })) | ||
157 | } | 164 | } | ||
158 | 165 | | |||
159 | menu.submenuComponent: ActionsMenu { | 166 | menu.submenuComponent: ActionsMenu { | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |