Compare commits

..

3 commits

Author SHA1 Message Date
1cd34f5019 fixing some slide changing bugs
Some checks are pending
/ test (push) Waiting to run
2025-12-08 15:12:25 -06:00
7a2a201455 some todo rewording 2025-12-08 15:12:15 -06:00
662a827003 a quick view of the song's verses to make sure things are working 2025-12-08 11:48:03 -06:00
4 changed files with 94 additions and 8 deletions

View file

@ -955,11 +955,13 @@ impl cosmic::Application for App {
let slide_index = self.current_item.1;
let item_index = self.current_item.0;
let mut tasks = vec![];
debug!(slide_index, item_index);
if let Some(item) =
self.service.get(item_index)
{
if item.slides.len() > slide_index + 1 {
let slide_index = slide_index + 1;
debug!(slide_index, item_index);
let action = self.presenter.update(
presenter::Message::ActivateSlide(
item_index,
@ -976,7 +978,7 @@ impl cosmic::Application for App {
}));
}
self.current_item =
(item_index, slide_index + 1);
(item_index, slide_index);
Task::batch(tasks)
} else {
// debug!("Slides are not longer");
@ -1030,7 +1032,7 @@ impl cosmic::Application for App {
}));
}
self.current_item =
(item_index, slide_index - 1);
(item_index, slide_index);
Task::batch(tasks)
} else if slide_index == 0
&& item_index == 0

View file

@ -216,6 +216,7 @@ impl Presenter {
// ));
}
Message::ActivateSlide(item_index, slide_index) => {
debug!(slide_index, item_index);
if let Some(slide) = self
.service
.get(item_index)

View file

@ -20,7 +20,11 @@ use tracing::{debug, error};
use crate::{
Background, BackgroundKind,
core::{service_items::ServiceTrait, slide::Slide, songs::Song},
core::{
service_items::ServiceTrait,
slide::Slide,
songs::{Song, Verse},
},
ui::{
presenter::slide_view, slide_editor::SlideEditor, text_svg,
},
@ -416,7 +420,86 @@ order",
]
.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)
.width(Length::FillPortion(2))
.into()

View file

@ -2,7 +2,7 @@
* 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
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.