Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2558. MenuBar positions wrong in some situations. #2567
Fixes #2558. MenuBar positions wrong in some situations. #2567
Changes from 1 commit
9ff50d3
82beaa1
80410ba
f759b27
fac62cc
b362bb3
d984bcb
c6c9fc3
d975a57
bc0bf2f
2d9b874
77f0b43
2816f67
ee4a3ee
100d49e
4c74092
14338b7
dd3a763
3c267c3
0f54fdd
b97f318
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand what these are for, nor do I think they are named correctly. My comments before still apply. I do not think these belong on
View
.You've said several times "Remember that there are views that needed to draw outside the Application.Top".
I'm either not understanding what you mean, or I disagree.
I know v1 didn't work this way, but I think v2 should:
Application
) can draw anywhere and will do so in some cases (e.g. drawing drop-shadows).If the view that is
Application.Top
is too small for content to fit within it's frame then the developer can make it bigger.I may be missing some very obvious scenario that you are seeing clearly though. Please help me see it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll move them to the
Menu
as private methods.Well, sorry I disagree with you in this specific matter. The user may not know the size of a drop-down, a context menu or other popup. If you use
WPF
orWindowsForms
it allows to draw outside the container of the control.@tig this unit test in the
ContextMenuTests
explain perfectly what I' saying. It's aTextField
on a smallerDialog
that is also theApplication.Top
and, of course, theApplication.Current
. As you can see theContextMenu
is also showing outside theDialog
bounds, over the non-full console.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, a ContextMenu is just a
Menu
which is aView
. TheDialog
is not drawing out side of it'sFrame
. TheMenu
is. And that's ok because it is not a subview of the dialog.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it's a sub view of the Dialog because is added into the Dialog. See the ContextMenu code. In the case of the MenuBar it really is a Dialog subview and it only is draw inside the Dialog frame. Only the Menu can be draw outside there aren't enough space to accommodate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember, in v2, 'MenuBar' will be a subview of 'view.Padding' (or maybe 'Border', I haven't decided yet).
'ContextMenu' should not be a View subclass at all. It is just a helper for causing 'Menu' objects to be shown without a 'MenuBar'.
Proposal to resolve this:
This solves both my desire to have a model where Views can't draw outside their superview.Bounds and the need for menus to sometimes escape.
Does this proposal sound reasonable to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that fit the logic of handling float views. I only have a doubt when you referred
Parent = Application.Top
may be is betterParent = Application.Current
. Imagine you have two toplevels opened and if the float view is managed by some view in theCurrent
, which is modal, then must be this one the container of the float view, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorta. In v2 I think
Application.Current
goes away with the concept of fully supportingOverlapped
. Any view can hostOverlapped
views (formerly called Mdi). There is only ONEApplication.Top
. It cannot be changed betweenRun/End
.However, ANY view can have overlapped subviews. ONE of those overalapped subviews can have the topmost "z-order", which is equivalent to "Current". It's also the same as "Most Focused" in Overlapped scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tig. Understood. Tell me what you want I change in this PR.