-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now modals receive a lambda that returns an Action. This makes modals infinitely more reusable than the previous ones. To illustrate, this is now possible: ```rust let add_modal = Box::new( InputModal::new() .style(Style::default().fg(Color::BrightRed)) .on_commit(|input| Action::AddSong(input)) ); let rename_modal = Box::new( InputModal::new() .style(Style::default().fg(Color::Blue)) .on_commit(|input| Action::RenameSongTo(input)) ); ``` No special case handling for each type of modal! Also, modals now send Action::CloseModal when appropriate, which closes any open modal. Previously each modal had its own match case to close itself...
- Loading branch information
1 parent
5ffd341
commit 0a874bb
Showing
8 changed files
with
178 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.