MenuBar changes global coordinate system origin (y=0 shifts downward by 24px), making it difficult to toggle MenuBar on/off #10136
Unanswered
kirtan2605
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’ve run into an issue with the
MenuBarcomponent that affects layout consistency.When a
MenuBaris present, the global coordinate system appears to shift so thaty = 0is located below theMenuBar.However, when no
MenuBaris used, y = 0 corresponds to the very top of the window, as expected.This becomes a problem when trying to toggle the
MenuBaron and off at runtime. Because enabling theMenuBarchanges the coordinate origin, the rest of the UI gets displaced downward, causing the entire application layout to shift unexpectedly.Expected behavior:
Ideally, adding or removing a
MenuBarshould not rebase the global coordinate system in a way that forces the rest of the UI to move, unless explicitly requested.Request / Questions:
Is it possible to prevent the
MenuBarfrom changing the reference coordinate system?If not currently possible, could there be an option—perhaps a property or style flag—to fix the coordinate origin so that the
MenuBardoes not affect the layout of the rest of the application?Alternatively, is there a recommended workaround for toggling a
MenuBarwithout causing layout distortion?This behavior makes it difficult to create applications with dynamically shown/hidden menu bars, as the UI jumps upon activation.
Thanks for considering this! Let me know if I can provide a minimal reproducible example.
Beta Was this translation helpful? Give feedback.
All reactions