Skip to content
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

Improved modal example 1 #238

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hydra
Copy link
Contributor

@hydra hydra commented Jan 10, 2025

First cut of an improved example, based on discussions here:

https://discord.com/channels/578968877866811403/842093272540643339/1327300473174102036

Video of modal-nested.rs

Screen.Recording.2025-01-13.105351.mp4

Status: Ready for review.

@hydra hydra force-pushed the improved-modal-example-1 branch from b985bab to 35827c3 Compare January 10, 2025 16:41
@hydra
Copy link
Contributor Author

hydra commented Jan 10, 2025

Added an example, in modal-split.rs for showing how to create two independent modals.

Screen.Recording.2025-01-10.185420.mp4

@hydra
Copy link
Contributor Author

hydra commented Jan 13, 2025

@ecton I'm noticing some focus issues with the modal-split.rs example.

I don't believe there's anything wrong with the code in this example itself and as such shouldn't prevent merging of this PR, but it uncovered a couple of issues which I documented here #240

hydra and others added 8 commits February 4, 2025 18:16
Dialog button callbacks now return a ShouldClose and are FnMut instead
of FnOnce. This allows nested dialogs to be invoked through the buttons
on a dialog in addition to the content of the dialog itself.

While doing this, I realized the documentation for
ModalHandle::build_dialog claimed it was used to create nested dialogs,
but it wasn't actually implemented that way. In trying to make the
modal.rs expanded example work, I wanted both behaviors -- updating the
current handle contents with a new dialog and creating a nested dialog,
so there is now a `ModalHandle::build_nested_dialog` function in
addition to the existing function.
@hydra hydra force-pushed the improved-modal-example-1 branch from 48509a9 to 59c6d0e Compare February 4, 2025 17:19
@hydra
Copy link
Contributor Author

hydra commented Feb 4, 2025

rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants