chore: refactor iced utils into shared module
This commit is contained in:
parent
efe0b45fbb
commit
1eb6403575
4 changed files with 22 additions and 19 deletions
|
|
@ -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>,
|
||||
|
|
@ -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;
|
||||
|
|
@ -9,5 +9,4 @@ pub mod prelude;
|
|||
pub mod quirks;
|
||||
pub mod rlimit;
|
||||
pub mod screenshot;
|
||||
pub mod state;
|
||||
pub mod tween;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue