Skip to content

Commit

Permalink
fixed musescore#27021: we should not position the popup offscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Eism committed Mar 11, 2025
1 parent 83e8b65 commit 2ddaef1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/playback/qml/MuseScore/Playback/SoundFlagPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ StyledPopupView {
signal elementRectChanged(var elementRect)

function updatePosition() {
var popupHeight = root.contentHeight + root.margins * 2 + root.padding * 2
root.y = -popupHeight
let popupHeight = root.contentHeight + root.margins * 2 + root.padding * 2
let yUp = -popupHeight

let globPos = root.parent.mapToItem(ui.rootItem, Qt.point(root.x, yUp))
if (globPos.y < 0) {
yUp = yUp + (0 - globPos.y)
}

root.y = yUp
root.x = (root.parent.width / 2) - (root.width / 2) + root.margins

root.setOpensUpward(true)
Expand Down

0 comments on commit 2ddaef1

Please sign in to comment.