This commit is contained in:
parent
adbfd8ce0f
commit
c482fb9c73
2 changed files with 21 additions and 1 deletions
16
src/main.rs
16
src/main.rs
|
@ -488,7 +488,21 @@ impl cosmic::Application for App {
|
|||
}
|
||||
|
||||
fn footer(&self) -> Option<Element<Self::Message>> {
|
||||
Some(text::body("Sux").into())
|
||||
let total_items_text =
|
||||
format!("Total Service Items: {}", self.service.len());
|
||||
let total_slides_text =
|
||||
format!("Total Slides: {}", self.presenter.total_slides);
|
||||
let row = row![
|
||||
text::body(total_items_text),
|
||||
text::body(total_slides_text)
|
||||
]
|
||||
.spacing(10);
|
||||
Some(
|
||||
Container::new(row)
|
||||
.align_right(Length::Fill)
|
||||
.padding([5, 0, 0, 0])
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
|
||||
fn subscription(&self) -> Subscription<Self::Message> {
|
||||
|
|
|
@ -50,6 +50,8 @@ pub(crate) struct Presenter {
|
|||
pub current_slide: Slide,
|
||||
pub current_item: usize,
|
||||
pub current_slide_index: usize,
|
||||
pub absolute_slide_index: usize,
|
||||
pub total_slides: usize,
|
||||
pub video: Option<Video>,
|
||||
pub video_position: f32,
|
||||
pub audio: Option<PathBuf>,
|
||||
|
@ -151,10 +153,14 @@ impl Presenter {
|
|||
None
|
||||
}
|
||||
};
|
||||
let total_slides: usize =
|
||||
items.iter().fold(0, |a, item| a + item.slides.len());
|
||||
Self {
|
||||
current_slide: items[0].slides[0].clone(),
|
||||
current_item: 0,
|
||||
current_slide_index: 0,
|
||||
absolute_slide_index: 0,
|
||||
total_slides,
|
||||
video,
|
||||
audio: items[0].slides[0].audio().clone(),
|
||||
service: items,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue