Compare commits
3 commits
7f8381fb83
...
1cd34f5019
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cd34f5019 | |||
| 7a2a201455 | |||
| 662a827003 |
4 changed files with 94 additions and 8 deletions
|
|
@ -955,11 +955,13 @@ impl cosmic::Application for App {
|
||||||
let slide_index = self.current_item.1;
|
let slide_index = self.current_item.1;
|
||||||
let item_index = self.current_item.0;
|
let item_index = self.current_item.0;
|
||||||
let mut tasks = vec![];
|
let mut tasks = vec![];
|
||||||
|
debug!(slide_index, item_index);
|
||||||
if let Some(item) =
|
if let Some(item) =
|
||||||
self.service.get(item_index)
|
self.service.get(item_index)
|
||||||
{
|
{
|
||||||
if item.slides.len() > slide_index + 1 {
|
if item.slides.len() > slide_index + 1 {
|
||||||
let slide_index = slide_index + 1;
|
let slide_index = slide_index + 1;
|
||||||
|
debug!(slide_index, item_index);
|
||||||
let action = self.presenter.update(
|
let action = self.presenter.update(
|
||||||
presenter::Message::ActivateSlide(
|
presenter::Message::ActivateSlide(
|
||||||
item_index,
|
item_index,
|
||||||
|
|
@ -976,7 +978,7 @@ impl cosmic::Application for App {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
self.current_item =
|
self.current_item =
|
||||||
(item_index, slide_index + 1);
|
(item_index, slide_index);
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
} else {
|
} else {
|
||||||
// debug!("Slides are not longer");
|
// debug!("Slides are not longer");
|
||||||
|
|
@ -1030,7 +1032,7 @@ impl cosmic::Application for App {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
self.current_item =
|
self.current_item =
|
||||||
(item_index, slide_index - 1);
|
(item_index, slide_index);
|
||||||
Task::batch(tasks)
|
Task::batch(tasks)
|
||||||
} else if slide_index == 0
|
} else if slide_index == 0
|
||||||
&& item_index == 0
|
&& item_index == 0
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,7 @@ impl Presenter {
|
||||||
// ));
|
// ));
|
||||||
}
|
}
|
||||||
Message::ActivateSlide(item_index, slide_index) => {
|
Message::ActivateSlide(item_index, slide_index) => {
|
||||||
|
debug!(slide_index, item_index);
|
||||||
if let Some(slide) = self
|
if let Some(slide) = self
|
||||||
.service
|
.service
|
||||||
.get(item_index)
|
.get(item_index)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,11 @@ use tracing::{debug, error};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Background, BackgroundKind,
|
Background, BackgroundKind,
|
||||||
core::{service_items::ServiceTrait, slide::Slide, songs::Song},
|
core::{
|
||||||
|
service_items::ServiceTrait,
|
||||||
|
slide::Slide,
|
||||||
|
songs::{Song, Verse},
|
||||||
|
},
|
||||||
ui::{
|
ui::{
|
||||||
presenter::slide_view, slide_editor::SlideEditor, text_svg,
|
presenter::slide_view, slide_editor::SlideEditor, text_svg,
|
||||||
},
|
},
|
||||||
|
|
@ -416,7 +420,86 @@ order",
|
||||||
]
|
]
|
||||||
.spacing(5);
|
.spacing(5);
|
||||||
|
|
||||||
column![title_input, author_input, verse_input, lyric_input,]
|
let verse_list = self.song.clone().map(|song| {
|
||||||
|
if let Some(verses) = song.verses.map(|verses| {
|
||||||
|
verses
|
||||||
|
.iter()
|
||||||
|
.map(|verse| match verse {
|
||||||
|
Verse::Verse { number, .. } => text({
|
||||||
|
let mut string = "Verse ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::PreChorus { number, lyric } => text({
|
||||||
|
let mut string =
|
||||||
|
"Pre-Chorus ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::Chorus { number, lyric } => text({
|
||||||
|
let mut string = "Chorus ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::PostChorus { number, lyric } => {
|
||||||
|
text({
|
||||||
|
let mut string =
|
||||||
|
"Post-Chorus ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Verse::Bridge { number, lyric } => text({
|
||||||
|
let mut string = "Bridge ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::Intro { number, lyric } => text({
|
||||||
|
let mut string = "Intro ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::Outro { number, lyric } => text({
|
||||||
|
let mut string = "Outro ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
Verse::Instrumental { number, lyric } => {
|
||||||
|
text({
|
||||||
|
let mut string =
|
||||||
|
"Instrumental ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Verse::Other { number, lyric } => text({
|
||||||
|
let mut string = "Other ".to_string();
|
||||||
|
string.push_str(&number.to_string());
|
||||||
|
string
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
}) {
|
||||||
|
verses
|
||||||
|
} else {
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let verse_list = if let Some(verse_list) = verse_list {
|
||||||
|
Element::from(row(verse_list
|
||||||
|
.into_iter()
|
||||||
|
.map(|v| Element::from(v))))
|
||||||
|
} else {
|
||||||
|
Element::from(horizontal_space())
|
||||||
|
};
|
||||||
|
|
||||||
|
column![
|
||||||
|
title_input,
|
||||||
|
author_input,
|
||||||
|
verse_input,
|
||||||
|
lyric_input,
|
||||||
|
verse_list
|
||||||
|
]
|
||||||
.spacing(25)
|
.spacing(25)
|
||||||
.width(Length::FillPortion(2))
|
.width(Length::FillPortion(2))
|
||||||
.into()
|
.into()
|
||||||
|
|
|
||||||
2
todo.org
2
todo.org
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
* TODO [#A] Need to fix tests now that the basic app is working
|
* TODO [#A] Need to fix tests now that the basic app is working
|
||||||
* TODO [#A] Allow for a way to split the presentation up but a right click menu for the presentation.
|
* TODO [#A] Allow for a way to split the presentation up with a right click menu for the presentation preview row.
|
||||||
* TODO [#A] Text could be built by using SVG instead of the text element. Maybe I could construct my own text element even
|
* TODO [#A] Text could be built by using SVG instead of the text element. Maybe I could construct my own text element even
|
||||||
This does almost work. There is a clear amount of lag or rather hang up since switching to the =text_svg= element. I think I may only keep it till I can figure out how to do strokes and shadows in iced's normal text element.
|
This does almost work. There is a clear amount of lag or rather hang up since switching to the =text_svg= element. I think I may only keep it till I can figure out how to do strokes and shadows in iced's normal text element.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue