Compare commits

...

2 commits

Author SHA1 Message Date
15b5966108 getting the todo a little more oriented
Some checks failed
/ test (push) Has been cancelled
2025-08-25 15:42:23 -05:00
c874590fb1 some testing on slide building 2025-08-25 15:42:12 -05:00
2 changed files with 33 additions and 9 deletions

View file

@ -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<cosmic::iced::mouse::Button>,
}
impl SlideEditor {
pub fn view<'a>(
@ -83,9 +85,14 @@ impl<'a> Program<SlideWidget, cosmic::Theme, cosmic::Renderer>
) -> Vec<canvas::Geometry<Renderer>> {
// 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<SlideWidget, cosmic::Theme, cosmic::Renderer>
.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<SlideWidget, cosmic::Theme, cosmic::Renderer>
&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<SlideWidget>) {
match event {
@ -117,8 +130,17 @@ impl<'a> Program<SlideWidget, cosmic::Theme, cosmic::Renderer>
}
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(

View file

@ -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