From 029188d632a48dfaa233999d11b53cd25baa3d15 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 15 Nov 2024 09:37:17 -0600 Subject: [PATCH] trying to make the slide preview more composable --- src/main.rs | 27 ++++++++++-------- src/ui/presenter.rs | 67 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 75 insertions(+), 19 deletions(-) diff --git a/src/main.rs b/src/main.rs index fc2b6ec..74b7f6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use clap::{command, Parser}; use cosmic::app::{Core, Settings, Task}; +use cosmic::dialog::ashpd::url::Url; use cosmic::iced::keyboard::Key; use cosmic::iced::window::Position; use cosmic::iced::{ @@ -12,7 +13,7 @@ use cosmic::widget::tooltip::Position as TPosition; use cosmic::widget::{button, image, nav_bar, text, tooltip, Space}; use cosmic::{executor, Application, ApplicationExt, Element}; use cosmic::{widget::Container, Theme}; -use iced_video_player::VideoPlayer; +use iced_video_player::{Video, VideoPlayer}; use miette::{miette, Result}; use std::path::PathBuf; use tracing::{debug, level_filters::LevelFilter}; @@ -68,16 +69,18 @@ fn theme(_state: &App) -> Theme { Theme::dark() } -struct App<'a> { +struct App { core: Core, nav_model: nav_bar::Model, file: PathBuf, - presenter: Presenter<'a>, + presenter: Presenter, windows: Vec, slides: Vec, + current_slide: Slide, + current_video: Option