Instead of dealing with a complication of every return from a component being a Task<Message>, I create an Action enum that only contains Tasks when needed and other specific actions that the overarching App should handle to interact with other parts of it.
27 lines
548 B
Rust
27 lines
548 B
Rust
use crate::core::model::LibraryKind;
|
|
|
|
pub mod double_ended_slider;
|
|
pub mod library;
|
|
pub mod presenter;
|
|
pub mod song_editor;
|
|
pub mod video;
|
|
|
|
pub enum EditorMode {
|
|
Song,
|
|
Image,
|
|
Video,
|
|
Presentation,
|
|
Slide,
|
|
}
|
|
|
|
impl From<LibraryKind> for EditorMode {
|
|
fn from(value: LibraryKind) -> Self {
|
|
match value {
|
|
LibraryKind::Song => Self::Song,
|
|
LibraryKind::Video => Self::Video,
|
|
LibraryKind::Image => Self::Image,
|
|
LibraryKind::Presentation => Self::Presentation,
|
|
}
|
|
}
|
|
}
|