diff --git a/src/qml/Base/HMenu.qml b/src/qml/Base/HMenu.qml index f96ba127..8e96d896 100644 --- a/src/qml/Base/HMenu.qml +++ b/src/qml/Base/HMenu.qml @@ -11,7 +11,9 @@ Menu { let rightPadding = 0 for (let i = 0; i < count; ++i) { - let item = itemAt(i) + let item = itemAt(i) + if (! item.visible) continue + result = Math.max(item.contentItem.implicitWidth, result) leftPadding = Math.max(item.leftPadding, leftPadding) rightPadding = Math.max(item.rightPadding, rightPadding) diff --git a/src/qml/Base/HMenuItem.qml b/src/qml/Base/HMenuItem.qml index 42012f5c..7be5ee4b 100644 --- a/src/qml/Base/HMenuItem.qml +++ b/src/qml/Base/HMenuItem.qml @@ -8,6 +8,7 @@ MenuItem { rightPadding: spacing topPadding: spacing / 1.75 bottomPadding: spacing / 1.75 + height: visible ? implicitHeight : 0 readonly property alias iconItem: contentItem.icon