diff --git a/Cargo.toml b/Cargo.toml index 51416ec..90f9d3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,48 +2,28 @@ name = "cosmic-time" version = "0.4.0" edition = "2021" -description = "An animation Crate for Iced and Cosmic DE" +description = "An animation Crate for libcosmic and Cosmic DE" authors = ["Brock Szuszczewicz "] license = "MIT" repository = "https://github.com/pop-os/cosmic-time" documentation = "https://docs.rs/cosmic-time" -keywords = ["gui", "animation", "interface", "widgets", "iced"] +keywords = ["gui", "animation", "interface", "widgets", "libcosmic"] categories = ["gui"] [features] -default = ["iced"] -iced = [ - "dep:iced", - "dep:iced_runtime", - "dep:iced_widget", - "dep:iced_futures", - "dep:iced_core", - "dep:iced_style", -] once_cell = ["dep:once_cell"] -wayland-libcosmic = ["libcosmic", "libcosmic/wayland"] -winit-libcosmic = ["libcosmic", "libcosmic/winit"] -libcosmic = ["dep:libcosmic"] [workspace] -members = ["examples/*"] +members = [] [dependencies] -iced = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", features = [ +libcosmic = { path = "../fork/libcosmic", default-features = false, features = [ "tokio", -], optional = true } -iced_runtime = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", optional = true } -iced_widget = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", optional = true } -iced_futures = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", optional = true } -iced_core = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", optional = true } -iced_style = { git = "https://github.com/iced-rs/iced", rev = "5540ac0", optional = true } -libcosmic = { git = "https://github.com/pop-os/libcosmic/", default-features = false, features = [ - "tokio", -], optional = true } +] } once_cell = { version = "1.18.0", optional = true } float-cmp = "0.9" # [patch.'https://github.com/pop-os/libcosmic'] -# libcosmic = { path = "../libcosmic" } -# cosmic-config = { path = "../libcosmic/cosmic-config" } -# cosmic-theme = { path = "../libcosmic/cosmic-theme" } +# libcosmic = { path = "../fork/libcosmic" } +# cosmic-config = { path = "../fork/libcosmic/cosmic-config" } +# cosmic-theme = { path = "../fork/libcosmic/cosmic-theme" } diff --git a/examples/pong/src/layer.rs b/examples/pong/src/layer.rs index fc92b62..6aef802 100644 --- a/examples/pong/src/layer.rs +++ b/examples/pong/src/layer.rs @@ -143,7 +143,7 @@ where state: &mut Tree, layout: Layout<'_>, renderer: &Renderer, - operation: &mut dyn widget::Operation, + operation: &mut dyn widget::Operation<()>, ) { self.base .as_widget() @@ -236,7 +236,7 @@ where &mut self, layout: Layout<'_>, renderer: &Renderer, - operation: &mut dyn widget::Operation, + operation: &mut dyn widget::Operation<()>, ) { self.content.as_widget().operate( self.tree, diff --git a/src/keyframes.rs b/src/keyframes.rs index 2dfec03..9758f4a 100644 --- a/src/keyframes.rs +++ b/src/keyframes.rs @@ -1,33 +1,14 @@ -mod button; -#[cfg(feature = "libcosmic")] mod cards; -mod column; -mod container; mod helpers; -mod row; -mod space; -mod style_button; -mod style_container; mod toggler; use crate::reexports::iced_core::{widget, Length}; -pub use button::Button; -#[cfg(feature = "libcosmic")] pub use cards::Cards; -pub use column::Column; -pub use container::Container; -#[cfg(feature = "libcosmic")] pub use helpers::cards; pub use helpers::id; pub use helpers::lazy; -pub use helpers::{ - button, chain, column, container, row, space, style_button, style_container, toggler, -}; -pub use row::Row; -pub use space::Space; -pub use style_button::StyleButton; -pub use style_container::StyleContainer; +pub use helpers::{chain, toggler}; pub use toggler::Toggler; use crate::Timeline; diff --git a/src/keyframes/button.rs b/src/keyframes/button.rs deleted file mode 100644 index b2d9237..0000000 --- a/src/keyframes/button.rs +++ /dev/null @@ -1,212 +0,0 @@ -use self::iced_core::{widget::Id as IcedId, Element, Length, Padding, Renderer as IcedRenderer}; -use crate::reexports::{iced_core, iced_style, iced_widget}; - -use crate::keyframes::{as_f32, get_length, Repeat}; -use crate::timeline::Frame; -use crate::{Ease, Linear, MovementType}; - -/// A Button's animation Id. Used for linking animation built in `update()` with widget output in `view()` -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Id(IcedId); - -impl Id { - /// Creates a custom [`Id`]. - pub fn new(id: impl Into>) -> Self { - Self(IcedId::new(id)) - } - - /// Creates a unique [`Id`]. - /// - /// This function produces a different [`Id`] every time it is called. - #[must_use] - pub fn unique() -> Self { - Self(IcedId::unique()) - } - - /// Used by [`crate::chain!`] macro - #[must_use] - pub fn into_chain(self) -> Chain { - Chain::new(self) - } - - /// Used by [`crate::chain!`] macro - #[must_use] - pub fn into_chain_with_children(self, children: Vec