back to song_editor looking right
This commit is contained in:
parent
b03382f687
commit
b9a9dda233
3 changed files with 72 additions and 55 deletions
|
|
@ -11,7 +11,7 @@ use cosmic::{
|
|||
theme,
|
||||
widget::{
|
||||
button, column, combo_box, container, horizontal_space, icon,
|
||||
text, text_editor, text_input,
|
||||
scrollable, text, text_editor, text_input,
|
||||
},
|
||||
Element, Task,
|
||||
};
|
||||
|
|
@ -20,8 +20,9 @@ use iced_video_player::Video;
|
|||
use tracing::{debug, error};
|
||||
|
||||
use crate::{
|
||||
core::songs::Song, ui::slide_editor::SlideEditor, Background,
|
||||
BackgroundKind,
|
||||
core::{service_items::ServiceTrait, songs::Song},
|
||||
ui::{presenter::slide_view, slide_editor::SlideEditor},
|
||||
Background, BackgroundKind,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -282,49 +283,48 @@ impl SongEditor {
|
|||
}
|
||||
|
||||
fn slide_preview(&self) -> Element<Message> {
|
||||
// if let Some(song) = &self.song {
|
||||
// if let Ok(slides) = song.to_slides() {
|
||||
// let slides = slides
|
||||
// .iter()
|
||||
// .enumerate()
|
||||
// .map(|(index, slide)| {
|
||||
// container(
|
||||
// slide_view(
|
||||
// slide.clone(),
|
||||
// if index == 0 {
|
||||
// &self.video
|
||||
// } else {
|
||||
// &None
|
||||
// },
|
||||
// self.current_font,
|
||||
// false,
|
||||
// false,
|
||||
// )
|
||||
// .map(|_| Message::None),
|
||||
// )
|
||||
// .height(250)
|
||||
// .center_x(Length::Fill)
|
||||
// .padding([0, 20])
|
||||
// .clip(true)
|
||||
// .into()
|
||||
// })
|
||||
// .collect();
|
||||
// scrollable(
|
||||
// column::with_children(slides)
|
||||
// .spacing(theme::active().cosmic().space_l()),
|
||||
// )
|
||||
// .height(Length::Fill)
|
||||
// .width(Length::Fill)
|
||||
// .into()
|
||||
// } else {
|
||||
// horizontal_space().into()
|
||||
// }
|
||||
// } else {
|
||||
// horizontal_space().into()
|
||||
// }
|
||||
self.slide_state
|
||||
.view(Font::with_name("Quicksand Bold"))
|
||||
.map(|_s| Message::None)
|
||||
if let Some(song) = &self.song {
|
||||
if let Ok(slides) = song.to_slides() {
|
||||
let slides: Vec<Element<Message>> = slides
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(index, slide)| {
|
||||
container(
|
||||
slide_view(
|
||||
slide,
|
||||
if index == 0 {
|
||||
&self.video
|
||||
} else {
|
||||
&None
|
||||
},
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.map(|_| Message::None),
|
||||
)
|
||||
.height(250)
|
||||
.center_x(Length::Fill)
|
||||
.padding([0, 20])
|
||||
.clip(true)
|
||||
.into()
|
||||
})
|
||||
.collect();
|
||||
scrollable(
|
||||
column::with_children(slides)
|
||||
.spacing(theme::active().cosmic().space_l()),
|
||||
)
|
||||
.height(Length::Fill)
|
||||
.width(Length::Fill)
|
||||
.into()
|
||||
} else {
|
||||
horizontal_space().into()
|
||||
}
|
||||
} else {
|
||||
horizontal_space().into()
|
||||
}
|
||||
// self.slide_state
|
||||
// .view(Font::with_name("Quicksand Bold"))
|
||||
// .map(|_s| Message::None)
|
||||
}
|
||||
|
||||
fn left_column(&self) -> Element<Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue