Skip to content

MenuView: fix x/y properties#7

Open
cbjeukendrup wants to merge 1 commit into
musescore:mainfrom
cbjeukendrup:menuview-fix-x-y-properties
Open

MenuView: fix x/y properties#7
cbjeukendrup wants to merge 1 commit into
musescore:mainfrom
cbjeukendrup:menuview-fix-x-y-properties

Conversation

@cbjeukendrup

Copy link
Copy Markdown
Contributor

Don’t override them immediately after setting them, in updateGeometry. Instead, set them in QML, and only when no explicit value for them is requested, hoping that this preserve the intention of the removed code (I must admit I’m not 100% sure what the intention was).

Also remove seemingly redundant calls to updateGeometry (but removing just those calls does not solve the problem).

@cbjeukendrup cbjeukendrup force-pushed the menuview-fix-x-y-properties branch 2 times, most recently from 5a321d0 to 02949a9 Compare May 16, 2026 16:09
@Eism Eism mentioned this pull request Jun 22, 2026
Don’t override them immediately after setting them, in `updateGeometry`. Instead, set them in QML, and only when no explicit value for them is requested, hoping that this preserve the intention of the removed code (I must admit I’m not 100% sure what the intention was).

Also remove seemingly redundant calls to `updateGeometry` (but removing just those calls does not solve the problem).
@cbjeukendrup cbjeukendrup force-pushed the menuview-fix-x-y-properties branch from 02949a9 to 65d037d Compare July 4, 2026 21:27
@cbjeukendrup

Copy link
Copy Markdown
Contributor Author

@mathesoncalum Kind reminder about this PR. The best way to see what it fixes, is testing musescore/MuseScore#33301, first without and then with this framework change.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8fa5bc64-c226-4459-bb75-c70310574b04

📥 Commits

Reviewing files that changed from the base of the PR and between 4d7c958 and 65d037d.

📒 Files selected for processing (2)
  • framework/uicomponents/qml/Muse/UiComponents/StyledMenuLoader.qml
  • framework/uicomponents/qml/Muse/UiComponents/menuview.cpp
💤 Files with no reviewable changes (1)
  • framework/uicomponents/qml/Muse/UiComponents/menuview.cpp

📝 Walkthrough

Walkthrough

This change adjusts menu positioning behavior. In StyledMenuLoader.qml, the update() function now sets menu.x to 0 when x is -1, and binds menu.y to the parent's height via Qt.binding when y is -1, instead of leaving these values unset. In menuview.cpp, the defer.h include is removed, setLocalX/setLocalY calls are removed from updateGeometry(), and calls to updateGeometry() are removed from the queued lambdas in setDesiredHeight() and setDesiredWidth() before repositionWindowIfNeed() is invoked.

Changes

Cohort / File Summary
StyledMenuLoader.qml Added x === -1 fallback (menu.x = 0) and changed y === -1 handling to use Qt.binding based on parent height
menuview.cpp Removed defer.h include, removed setLocalX/setLocalY in updateGeometry(), removed updateGeometry() calls in setDesiredHeight()/setDesiredWidth() queued lambdas

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant MenuView
  Caller->>MenuView: setDesiredHeight()/setDesiredWidth()
  MenuView->>MenuView: QMetaObject::invokeMethod (queued)
  MenuView->>MenuView: repositionWindowIfNeed()
Loading

Estimated code review effort: 3/5 (Medium) — changes touch coordinated positioning logic across QML and C++ layers, requiring verification of layout behavior in multiple scenarios.

Related issues: None provided.

Related PRs: None provided.

Suggested labels: ui, bug-fix, needs-testing

Suggested reviewers: None provided.

🐰 A menu that once wandered stray,
Now binds its height in a tidy way,
No more setLocalX to roam,
Geometry updates find a calmer home,
Hop by hop, the layout's set to sway.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description omits the required issue reference and checklist sections from the template. Add the Resolves line, a short problem/motivation summary, and complete the required checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main MenuView x/y fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mathesoncalum

Copy link
Copy Markdown
Contributor

/build

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants