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
32
Cargo.lock
generated
32
Cargo.lock
generated
|
|
@ -901,7 +901,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config"
|
name = "cosmic-config"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"calloop 0.14.4",
|
"calloop 0.14.4",
|
||||||
|
|
@ -922,7 +922,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config-derive"
|
name = "cosmic-config-derive"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
|
|
@ -1000,7 +1000,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.18.2"
|
version = "0.18.2"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#29034e56b47b7e259f9a18a01fcda8ff267fc2d1"
|
source = "git+https://github.com/pop-os/cosmic-text.git#b6216ad123814c41c35943390727b4e7146cd143"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"fontdb",
|
"fontdb",
|
||||||
|
|
@ -1023,7 +1023,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-theme"
|
name = "cosmic-theme"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"configparser",
|
"configparser",
|
||||||
|
|
@ -2259,7 +2259,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2278,7 +2278,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -2301,7 +2301,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_debug"
|
name = "iced_debug"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -2311,7 +2311,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2324,7 +2324,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2345,7 +2345,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_program"
|
name = "iced_program"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
|
|
@ -2354,7 +2354,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_renderer"
|
name = "iced_renderer"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -2366,7 +2366,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_runtime"
|
name = "iced_runtime"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -2380,7 +2380,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_tiny_skia"
|
name = "iced_tiny_skia"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -2397,7 +2397,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"as-raw-xcb-connection",
|
"as-raw-xcb-connection",
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
|
|
@ -2428,7 +2428,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.14.2"
|
version = "0.14.2"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
|
|
@ -2898,7 +2898,7 @@ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#ad65416551975cded91007b491b46556a45e059a"
|
source = "git+https://github.com/pop-os/libcosmic#ff6454248ff0f2ffe889798ef9610a1f8e5384e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"auto_enums",
|
"auto_enums",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
pub mod state;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
fmt,
|
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"));
|
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 {
|
pub trait IcedProgram {
|
||||||
type Message: std::fmt::Debug + Send;
|
type Message: std::fmt::Debug + Send;
|
||||||
fn update(&mut self, _message: Self::Message) -> Task<Self::Message> {
|
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> {
|
struct ProgramWrapper<P: Program> {
|
||||||
program: P,
|
program: P,
|
||||||
evlh: LoopHandle<'static, crate::state::State>,
|
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::event::{self, Event};
|
||||||
use cosmic::iced::core::mouse;
|
use cosmic::iced::core::mouse;
|
||||||
use cosmic::iced::core::renderer;
|
use cosmic::iced::core::renderer;
|
||||||
|
|
@ -9,5 +9,4 @@ pub mod prelude;
|
||||||
pub mod quirks;
|
pub mod quirks;
|
||||||
pub mod rlimit;
|
pub mod rlimit;
|
||||||
pub mod screenshot;
|
pub mod screenshot;
|
||||||
pub mod state;
|
|
||||||
pub mod tween;
|
pub mod tween;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue