Skip to content

Commit

Permalink
Fix bug in menu width calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
trin94 committed Dec 2, 2024
1 parent 5b44509 commit ee4c12d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qml/shared/MpvqcMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Menu {
popupType: Qt.platform.os === "windows" ? Popup.Window : Popup.Item
dim: false

width: {
width: calculateMenuWidths()

function calculateMenuWidths(): int {
// Adapted from: https://martin.rpdev.net/2018/03/13/qt-quick-controls-2-automatically-set-the-width-of-menus.html
let result = 0;
let padding = 0;
Expand All @@ -47,4 +49,5 @@ Menu {
function isMenuSeparator(item: Item): bool {
return item instanceof MenuSeparator;
}

}

0 comments on commit ee4c12d

Please sign in to comment.