chore: refactor iced utils into shared module

This commit is contained in:
Ashley Wulber 2026-03-09 14:05:54 -04:00 committed by Ashley Wulber
parent efe0b45fbb
commit 1eb6403575
4 changed files with 22 additions and 19 deletions

View file

@ -1,3 +1,5 @@
pub mod state;
use std::{
collections::{HashMap, HashSet},
fmt,
@ -62,7 +64,7 @@ use smithay::{
},
};
use crate::utils::state::State;
use crate::utils::iced::state::State;
static ID: LazyLock<Id> = LazyLock::new(|| Id::new("Program"));
@ -97,6 +99,7 @@ impl<P: Program + Send + 'static> Hash for IcedElement<P> {
}
}
// TODO remove this and use our Program trait directly instead
pub trait IcedProgram {
type Message: std::fmt::Debug + Send;
fn update(&mut self, _message: Self::Message) -> Task<Self::Message> {
@ -145,6 +148,7 @@ pub trait Program {
}
}
// TODO remove this and use our Program trait directly
struct ProgramWrapper<P: Program> {
program: P,
evlh: LoopHandle<'static, crate::state::State>,

View file

@ -1,4 +1,4 @@
use super::iced::IcedProgram as Program;
use super::IcedProgram as Program;
use cosmic::iced::core::event::{self, Event};
use cosmic::iced::core::mouse;
use cosmic::iced::core::renderer;

View file

@ -9,5 +9,4 @@ pub mod prelude;
pub mod quirks;
pub mod rlimit;
pub mod screenshot;
pub mod state;
pub mod tween;