From 035ab1add6b948e4282843d7fd0be3ffd2c81de4 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Sep 2019 11:21:31 -0400 Subject: [PATCH] HMenu: Fix width calculation (padding) --- src/qml/Base/HMenu.qml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/qml/Base/HMenu.qml b/src/qml/Base/HMenu.qml index d89cc417..34d25ea5 100644 --- a/src/qml/Base/HMenu.qml +++ b/src/qml/Base/HMenu.qml @@ -6,21 +6,15 @@ Menu { padding: theme.controls.menu.borderWidth implicitWidth: { - let result = 0 - let leftPadding = 0 - let rightPadding = 0 + let result = 0 for (let i = 0; i < count; ++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) + result = Math.max(item.implicitWidth, result) } - return Math.min( - result + leftPadding + rightPadding, window.width - ) + return Math.min(result + menu.padding * 2, window.width) } background: Rectangle {