MenuView: fix x/y properties#7
Conversation
5a321d0 to
02949a9
Compare
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).
02949a9 to
65d037d
Compare
|
@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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis 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
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MenuView
Caller->>MenuView: setDesiredHeight()/setDesiredWidth()
MenuView->>MenuView: QMetaObject::invokeMethod (queued)
MenuView->>MenuView: repositionWindowIfNeed()
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, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/build |
|
Build dispatched: https://github.com/musescore/muse_framework/actions/runs/28778902981 |
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).