updating crates

This commit is contained in:
Chris Cochrun 2025-03-12 15:58:46 -05:00
parent 2a980e523c
commit 7d92afb30a
3 changed files with 1973 additions and 438 deletions

2374
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -27,4 +27,6 @@ crisp = { git = "https://git.tfcconnection.org/chris/crisp", version = "0.1.3" }
rodio = { version = "0.20.1", features = ["symphonia-all", "tracing"] }
gstreamer = "0.23.3"
gstreamer-app = "0.23.3"
cosmic-time = "0.2.0"
rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false }

View file

@ -52,6 +52,7 @@ pub enum Message {
ChangeTitle(String),
ChangeVerseOrder(String),
ChangeLyrics(text_editor::Action),
ChangeBackground,
Edit(bool),
None,
ChangeAuthor(String),
@ -201,6 +202,38 @@ impl SongEditor {
Task::none()
}
}
Message::ChangeBackground => {
let background = rfd::FileDialog::new()
.pick_file()
.and_then(|f| {
Background::try_from(f)
.map_or(None, |f| Some(f))
});
if let Some(mut song) = self.song.clone() {
song.background = self.background.clone();
self.update(Message::UpdateSong(song))
} else {
Task::none()
}
// todo!()
// if let Some(mut song) = self.song.clone() {
// Task::future(
// rfd::AsyncFileDialog::new().pick_file(),
// )
// .and_then(move |f| {
// song.background = f
// .path()
// .try_into()
// .map_or(None, |b| Some(b));
// Task::none()
// })
// } else {
// Task::none()
// }
}
}
}
@ -322,7 +355,7 @@ order",
)
.label("Background")
.tooltip("Select an image or video background")
.on_press(Message::None)
.on_press(Message::ChangeBackground)
.padding(10);
row![