From 23cd34388b11dc081c9ba5888e053bf55102cdb9 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 2 Sep 2025 09:19:10 -0500 Subject: [PATCH 1/2] update todo --- todo.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/todo.org b/todo.org index 005086d..427d985 100644 --- a/todo.org +++ b/todo.org @@ -16,6 +16,10 @@ Actually, what if we just made the svg at load/creation time and stored it in th ** SVG performs badly Since SVG's apparently run poorly in iced, instead I'll need to see about either creating a new text element, or teaching Iced to render strokes and shadows on text. +** Fork Cryoglyph +This fork will render text 3 times. Once for the text, once for the stroke, once for the shadow. This will only be used in the slides and therefore should not be much of a performance hit since we will only be render 3 copies of the given text. This should not be bad performance since it's not a large amount of text. + +This also means in our custom widget with our custom fork, we can animate each individually perhaps. * TODO [#C] Make the presenter more modular so things are easier to change. From 4792304d8b75af1e159324d44c66be14a3c06fe3 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 2 Sep 2025 09:19:17 -0500 Subject: [PATCH 2/2] remove unused use statements --- src/ui/presenter.rs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 565cead..5a604b5 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -1,38 +1,37 @@ use miette::{IntoDiagnostic, Result}; -use resvg::usvg::fontdb; use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc}; use cosmic::{ + Task, iced::{ + Background, Border, Color, ContentFit, Font, Length, Shadow, + Vector, alignment::Horizontal, border, font::{Family, Stretch, Style, Weight}, - Background, Border, Color, ContentFit, Font, Length, Shadow, - Vector, }, iced_widget::{ rich_text, scrollable::{ - scroll_to, AbsoluteOffset, Direction, Scrollbar, + AbsoluteOffset, Direction, Scrollbar, scroll_to, }, span, stack, vertical_rule, }, prelude::*, widget::{ - container, image, mouse_area, responsive, scrollable, text, - Column, Container, Id, Row, Space, + Column, Container, Id, Row, Space, container, image, + mouse_area, responsive, scrollable, text, }, - Task, }; -use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer}; +use iced_video_player::{Position, Video, VideoPlayer, gst_pbutils}; use rodio::{Decoder, OutputStream, Sink}; use tracing::{debug, error, info, warn}; use url::Url; use crate::{ + BackgroundKind, core::{service_items::ServiceItem, slide::Slide}, ui::text_svg, - BackgroundKind, }; const REFERENCE_WIDTH: f32 = 1920.0; @@ -133,7 +132,9 @@ impl Presenter { Some(v) } Err(e) => { - error!("Had an error creating the video object: {e}, likely the first slide isn't a video"); + error!( + "Had an error creating the video object: {e}, likely the first slide isn't a video" + ); None } } @@ -379,7 +380,7 @@ impl Presenter { self.hovered_slide = slide; } Message::StartAudio => { - return Action::Task(self.start_audio()) + return Action::Task(self.start_audio()); } Message::EndAudio => { self.sink.1.stop(); @@ -642,7 +643,9 @@ impl Presenter { self.video = Some(v) } Err(e) => { - error!("Had an error creating the video object: {e}"); + error!( + "Had an error creating the video object: {e}" + ); self.video = None; } }