This commit is contained in:
parent
1861f357a8
commit
80a9b48ae9
4 changed files with 151 additions and 1190 deletions
1234
Cargo.lock
generated
1234
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -47,7 +47,7 @@ branch = "master"
|
||||||
features = ["wgpu", "image", "advanced", "svg", "canvas", "hot", "debug", "lazy", "tokio"]
|
features = ["wgpu", "image", "advanced", "svg", "canvas", "hot", "debug", "lazy", "tokio"]
|
||||||
|
|
||||||
[dependencies.iced_video_player]
|
[dependencies.iced_video_player]
|
||||||
git = "https://github.com/jazzfool/iced_video_player.git"
|
git = "https://git.tfcconnection.org/chris/iced_video_player"
|
||||||
branch = "master"
|
branch = "master"
|
||||||
# branch = "cosmic"
|
# branch = "cosmic"
|
||||||
|
|
||||||
|
|
|
@ -709,7 +709,13 @@ pub(crate) fn slide_view(
|
||||||
let lines = slide_text.lines();
|
let lines = slide_text.lines();
|
||||||
let text: Vec<Element<Message>> = lines
|
let text: Vec<Element<Message>> = lines
|
||||||
.map(|t| {
|
.map(|t| {
|
||||||
rich_text([span(format!("{}\n", t))
|
rich_text::<
|
||||||
|
'_,
|
||||||
|
&str,
|
||||||
|
Message,
|
||||||
|
iced::Theme,
|
||||||
|
iced::Renderer,
|
||||||
|
>([span(format!("{}\n", t))
|
||||||
.background(
|
.background(
|
||||||
Background::Color(Color::BLACK)
|
Background::Color(Color::BLACK)
|
||||||
.scale_alpha(0.4),
|
.scale_alpha(0.4),
|
||||||
|
|
|
@ -4,15 +4,14 @@ use dirs::font_dir;
|
||||||
use iced::{
|
use iced::{
|
||||||
advanced::graphics::text::cosmic_text::fontdb,
|
advanced::graphics::text::cosmic_text::fontdb,
|
||||||
font::{Family, Stretch, Style, Weight},
|
font::{Family, Stretch, Style, Weight},
|
||||||
theme,
|
|
||||||
widget::{
|
widget::{
|
||||||
button, column, combo_box, container, horizontal_space, row,
|
button, column, combo_box, container, horizontal_space, row,
|
||||||
scrollable, text, text_editor, text_input, tooltip,
|
scrollable, text, text_editor, text_input, tooltip,
|
||||||
|
TextInput,
|
||||||
},
|
},
|
||||||
Element, Font, Length, Task,
|
Element, Font, Length, Task,
|
||||||
};
|
};
|
||||||
use iced_video_player::Video;
|
use iced_video_player::Video;
|
||||||
use rfd::AsyncFileDialog;
|
|
||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -279,66 +278,62 @@ impl SongEditor {
|
||||||
.center_x(Length::FillPortion(2)),
|
.center_x(Length::FillPortion(2)),
|
||||||
container(slide_preview)
|
container(slide_preview)
|
||||||
.center_x(Length::FillPortion(3))
|
.center_x(Length::FillPortion(3))
|
||||||
]
|
],
|
||||||
.into(),
|
|
||||||
]
|
]
|
||||||
.spacing(15);
|
.spacing(15);
|
||||||
column.into()
|
column.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn slide_preview(&self) -> Element<Message> {
|
fn slide_preview(&self) -> Element<Message> {
|
||||||
// if let Some(song) = &self.song {
|
if let Some(song) = &self.song {
|
||||||
// if let Ok(slides) = song.to_slides() {
|
if let Ok(slides) = song.to_slides() {
|
||||||
// let slides = slides
|
let slides = slides
|
||||||
// .iter()
|
.iter()
|
||||||
// .enumerate()
|
.enumerate()
|
||||||
// .map(|(index, slide)| {
|
.map(|(index, slide)| {
|
||||||
// container(
|
container(
|
||||||
// slide_view(
|
slide_view(
|
||||||
// slide.clone(),
|
slide.clone(),
|
||||||
// if index == 0 {
|
if index == 0 {
|
||||||
// &self.video
|
&self.video
|
||||||
// } else {
|
} else {
|
||||||
// &None
|
&None
|
||||||
// },
|
},
|
||||||
// self.current_font,
|
self.current_font,
|
||||||
// false,
|
false,
|
||||||
// false,
|
false,
|
||||||
// )
|
)
|
||||||
// .map(|_| Message::None),
|
.map(|_| Message::None),
|
||||||
// )
|
)
|
||||||
// .height(250)
|
.height(250)
|
||||||
// .center_x(Length::Fill)
|
.center_x(Length::Fill)
|
||||||
// .padding([0, 20])
|
.padding([0, 20])
|
||||||
// .clip(true)
|
.clip(true)
|
||||||
// .into()
|
.into()
|
||||||
// })
|
})
|
||||||
// .collect();
|
.collect();
|
||||||
// scrollable(
|
scrollable(column(slides).spacing(20))
|
||||||
// column::with_children(slides)
|
.height(Length::Fill)
|
||||||
// .spacing(theme::active().iced().space_l()),
|
.width(Length::Fill)
|
||||||
// )
|
.into()
|
||||||
// .height(Length::Fill)
|
} else {
|
||||||
// .width(Length::Fill)
|
horizontal_space().into()
|
||||||
// .into()
|
}
|
||||||
// } else {
|
} else {
|
||||||
// horizontal_space().into()
|
horizontal_space().into()
|
||||||
// }
|
}
|
||||||
// } else {
|
// self.slide_state
|
||||||
// horizontal_space().into()
|
// .view(Font::with_name("Quicksand Bold"))
|
||||||
// }
|
// .map(|_s| Message::None)
|
||||||
self.slide_state
|
// .into()
|
||||||
.view(Font::with_name("Quicksand Bold"))
|
|
||||||
.map(|_s| Message::None)
|
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn left_column(&self) -> Element<Message> {
|
fn left_column(&self) -> Element<Message> {
|
||||||
let title_input = text_input("song", &self.title)
|
let title_input = text_input("song", self.title.as_ref())
|
||||||
.on_input(Message::ChangeTitle);
|
.on_input(|_| Message::ChangeTitle);
|
||||||
|
|
||||||
let author_input = text_input("author", &self.author)
|
let author_input = text_input("author", &self.author)
|
||||||
.on_input(Message::ChangeAuthor);
|
.on_input(|_| Message::ChangeAuthor);
|
||||||
|
|
||||||
let verse_input = text_input(
|
let verse_input = text_input(
|
||||||
"Verse
|
"Verse
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue