Modal Dialog - #4627
Modal Dialog#4627Murmele wants to merge 2 commits into
Conversation
Was that #4543 ? |
Yes it was |
3a46b55 to
8ac3fb9
Compare
1a70787 to
e33c0e8
Compare
#Conflicts: # winit-appkit/src/window_delegate.rs # winit-wayland/src/event_loop/mod.rs # winit-wayland/src/popup.rs # winit-wayland/src/window/common.rs # winit-win32/src/window.rs # winit-x11/src/window.rs
|
@dhardy , since you had opinions about the Popup change, maybe you want to have a look at this? |
dhardy
left a comment
There was a problem hiding this comment.
Looking just at the API, this seems acceptable.
That said, I'm not wildly enthusiastic about pushing all of the window properties into WindowAttributes: it is left to documentation to describe which attributes are applicable to which window types. I can see two possible alternatives here:
- Moving attributes applicable to only one window type into
WindowTypevariant fields (e.g.titleandiconshould only be applicable to full windows). - Having separate
create_window,create_popupandcreate_dialogmethods, each with their own_Attributesstruct. - (Variant of above):
create_window+create_subwindowwithWindowTypeonly used in the latter case; the rationale being that all subwindows need a parent.
| pub window_type: WindowType, | ||
| /// See [`WindowAttributes::with_positioner`]. | ||
| pub positioner: Option<WindowPositioner>, | ||
| pub modal: Option<bool>, |
There was a problem hiding this comment.
Why Option<bool>? What happens if this is None with WindowType::Dialog?
| /// - **X11, Web, Android, iOS, Orbital:** An error is returned because it is not implemented. | ||
| /// | ||
| /// [owned windows]: https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows | ||
| Dialog, |
There was a problem hiding this comment.
Possibly it would make sense to put modal: bool under WindowType::Dialog since it is not applicable to any other window type.
(The same may apply to popup positioning information, but if so best leave that to another PR.)
Implement modal dialogs. This branch is based on the work of the Popup branch so this must be merged first. Only the last commit here is relevant for dialog
changelogmodule if knowledge of this change could be valuable to usersWhat is missing to be ready
Os