Conversation
|
Hey mkalte, Thank you for this PR! The fact that we have to render our own title bar is quite annoying. I think egui should enable something like this in modals by default. But your implementation is a good workaround for now. I'll take a closer look at the PR this evening. |
|
Thanks for your message. Egui has an internal TitleBar struct for this, which sadly is not exposed. Also, from reading it, i doubt you can be adapted "just like that". What im doing is quite cheaty. I have updated, squashed commits, fixed the clippy warnings i got locally, and edited the commit message to follow your naming convenctions. Hope this helps. One thing i have not been able to fix so far is enable moving of the modal window. I will tinker around with this a bit more and maybe update this again in an hour or so. This will probably mostly affect the create_modal function however, and its Area properties, so everything else should stay as is (tm). |
|
Ok, so the egui builtin modal is intentionally made to be centered. Either
I am not sure what the best approach would be - its not my library after all. The only thing im sure of is that it cannot remain as is; the initial reason i created this PR in the first place is that a file dialog created from within a native egui modal will not properly overlay the modal that created it, even though the dialogs are the last thing i draw in my main drawing function. |
|
Thank you for putting so much time into this. At the moment the egui modals still feel relatively rudimentary. I think we should just live with the fact that we can't move the window in modal mode and update the documentation accordingly. In the end, I don't really see a use case for wanting to move a modal window anyway. If that is desired in the future, we will probably have to open an issue or PR at egui. |
|
I've tested the changes a bit. So far, it looks good. I don't think the biggest issue is that we can't move the window, but rather that we can't resize it. Is this configurable in egui's modal windows? I haven't used the built-in modals myself. If that's not possible, it's probably best to open an issue at egui to get the modals to work with regular windows. |
As far as i know it is not, but i think it can be feasibly emulated as well. If you aren't in a rush, i think i can allocate some time at work Thursday or Friday to work on this again. |
That would be great if you could take a look after that. I only build a new release when there's one at egui anyway. So no stress about getting it done quickly :) |
I have not forgotten about this, im just quite busy o.o |
|
@mkalte666 Everything's fine, I understand! The file dialog still works with the custom implementation, so no stress. Take your time :) |
This commit modifies the drawing routines so that instead of using a
custom modal implementaion, eguis native egui::containers::Modal is
used.
This comes with a few modifications:
* FileDialog::update_ui() now either creates a modal, or a window.
* In case as_modal is true, we fake a title bar, for consistent looks.
* In case as_modal is true, inner modals are drawn using eguis modal
functionality as well, and are nested (so, their own drawn overlay).
* Custom background drawing and input blocking has been removed.
This closes jannistpl#232
Have a good day!
~mkalte
This commit/PR modifies the drawing routines so that instead of using a custom modal implementation, eguis native egui::containers::Modal is used.
This comes with a few modifications:
Todos left are
the as_modal=true case; inputs should be blocked so that might be
prettier.
EDIT: ok my afternoon plans were canceled the moment i posted the pr, so i went on and this was honestly a quick thing to check, and with the early return it works nicely.
Feel free to review, i think i am done with this for now.
This closes #232
Have a good day!
~mkalte