From c874590fb1bc63dd647a0d98a7afc477190355b8 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 25 Aug 2025 15:42:12 -0500 Subject: [PATCH 1/2] some testing on slide building --- src/ui/slide_editor.rs | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/ui/slide_editor.rs b/src/ui/slide_editor.rs index fb12342..018e936 100644 --- a/src/ui/slide_editor.rs +++ b/src/ui/slide_editor.rs @@ -1,7 +1,7 @@ use std::{io, path::PathBuf}; use cosmic::{ - iced::{Color, Font, Length}, + iced::{Color, Font, Length, Size}, prelude::*, widget::{ self, @@ -50,7 +50,9 @@ pub enum SlideError { } #[derive(Debug, Default)] -struct EditorProgram {} +struct EditorProgram { + mouse_button_pressed: Option, +} impl SlideEditor { pub fn view<'a>( @@ -83,9 +85,14 @@ impl<'a> Program ) -> Vec> { // We prepare a new `Frame` let mut frame = canvas::Frame::new(renderer, bounds.size()); + let frame_rect = bounds.shrink(10); // We create a `Path` representing a simple circle let circle = canvas::Path::circle(frame.center(), 50.0); + let border = canvas::Path::rectangle( + cosmic::iced::Point { x: 10.0, y: 10.0 }, + Size::new(frame_rect.width, frame_rect.height), + ); // And fill it with some color frame.fill(&circle, Color::BLACK); @@ -95,6 +102,12 @@ impl<'a> Program .with_width(5.0) .with_color(Color::BLACK), ); + frame.stroke( + &border, + Stroke::default() + .with_width(5.0) + .with_color(Color::BLACK), + ); // Then, we produce the geometry vec![frame.into_geometry()] @@ -104,7 +117,7 @@ impl<'a> Program &self, _state: &mut Self::State, event: canvas::Event, - _bounds: cosmic::iced::Rectangle, + bounds: cosmic::iced::Rectangle, _cursor: cosmic::iced_core::mouse::Cursor, ) -> (canvas::event::Status, Option) { match event { @@ -117,8 +130,17 @@ impl<'a> Program } cosmic::iced::mouse::Event::CursorMoved { position, - } => debug!(?position, "cursor moved"), + } => { + if bounds.x < position.x + && bounds.y < position.y + && (bounds.width + bounds.x) > position.x + && (bounds.height + bounds.y) > position.y + { + debug!(?position, "cursor moved"); + } + } cosmic::iced::mouse::Event::ButtonPressed(button) => { + // self.mouse_button_pressed = Some(button); debug!(?button, "mouse button pressed") } cosmic::iced::mouse::Event::ButtonReleased( From 15b59661088dd8ef37f2d58b7d0707efc7cbef67 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 25 Aug 2025 15:42:23 -0500 Subject: [PATCH 2/2] getting the todo a little more oriented --- todo.org | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/todo.org b/todo.org index 0a8457a..005086d 100644 --- a/todo.org +++ b/todo.org @@ -1,6 +1,13 @@ #+TITLE: The Task list for Lumina +* TODO [#A] Develop DnD for library items +This is limited by the fact that I need to develop this in cosmic. I am honestly thinking that I'll need to build my own drag and drop system or at least work with system76 to fix their dnd system on other systems. + +This needs lots more attention + +* TODO [#A] Need to fix tests now that the basic app is working + * TODO Check into =mupdf-rs= for loading PDF's. * 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. @@ -12,14 +19,9 @@ Since SVG's apparently run poorly in iced, instead I'll need to see about either * TODO [#C] Make the presenter more modular so things are easier to change. -* TODO [#A] Need to fix tests now that the basic app is working - * TODO Build library to see all available songs, images, videos, presentations, and slides ** DONE Develop ui for libraries I've got the library basic layer done, I need to develop a way to open the libraries accordion button and then show the list of items in the library -** TODO [#A] Develop DnD for library items -This is limited by the fact that I need to develop this in cosmic. I am honestly thinking that I'll need to build my own drag and drop system or at least work with system76 to fix their dnd system on other systems. - * TODO [#B] Build editors for each possible item ** TODO Develop ui for editors