diff options
author | 2024-03-07 00:14:41 +0100 | |
---|---|---|
committer | 2024-03-07 00:14:41 +0100 | |
commit | 905f2160e6eb7504f52d9bd62c7bfa42c8ec2902 (patch) | |
tree | 9d5915ab355facbca08b6be3d7eac03c7b5d9acc /core | |
parent | 7c4bf70023a8092faad9630c2c87fbf41bd6ab76 (diff) | |
download | iced-905f2160e6eb7504f52d9bd62c7bfa42c8ec2902.tar.gz iced-905f2160e6eb7504f52d9bd62c7bfa42c8ec2902.tar.bz2 iced-905f2160e6eb7504f52d9bd62c7bfa42c8ec2902.zip |
Move `Theme` type to `iced_core`
Diffstat (limited to '')
-rw-r--r-- | core/Cargo.toml | 3 | ||||
-rw-r--r-- | core/src/color.rs | 6 | ||||
-rw-r--r-- | core/src/lib.rs | 2 | ||||
-rw-r--r-- | core/src/theme.rs (renamed from style/src/theme.rs) | 0 | ||||
-rw-r--r-- | core/src/theme/palette.rs (renamed from style/src/theme/palette.rs) | 2 |
5 files changed, 4 insertions, 9 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index 2360e822..e71b75ae 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -19,9 +19,8 @@ smol_str.workspace = true thiserror.workspace = true web-time.workspace = true xxhash-rust.workspace = true - palette.workspace = true -palette.optional = true +once_cell.workspace = true [target.'cfg(windows)'.dependencies] raw-window-handle.workspace = true diff --git a/core/src/color.rs b/core/src/color.rs index 6526e220..da40ca15 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "palette")] use palette::rgb::{Srgb, Srgba}; /// A color in the `sRGB` color space. @@ -210,7 +209,6 @@ macro_rules! color { }}; } -#[cfg(feature = "palette")] /// Converts from palette's `Rgba` type to a [`Color`]. impl From<Srgba> for Color { fn from(rgba: Srgba) -> Self { @@ -218,7 +216,6 @@ impl From<Srgba> for Color { } } -#[cfg(feature = "palette")] /// Converts from [`Color`] to palette's `Rgba` type. impl From<Color> for Srgba { fn from(c: Color) -> Self { @@ -226,7 +223,6 @@ impl From<Color> for Srgba { } } -#[cfg(feature = "palette")] /// Converts from palette's `Rgb` type to a [`Color`]. impl From<Srgb> for Color { fn from(rgb: Srgb) -> Self { @@ -234,7 +230,6 @@ impl From<Srgb> for Color { } } -#[cfg(feature = "palette")] /// Converts from [`Color`] to palette's `Rgb` type. impl From<Color> for Srgb { fn from(c: Color) -> Self { @@ -242,7 +237,6 @@ impl From<Color> for Srgb { } } -#[cfg(feature = "palette")] #[cfg(test)] mod tests { use super::*; diff --git a/core/src/lib.rs b/core/src/lib.rs index 002336ee..d076413e 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -30,6 +30,7 @@ pub mod overlay; pub mod renderer; pub mod svg; pub mod text; +pub mod theme; pub mod time; pub mod touch; pub mod widget; @@ -76,6 +77,7 @@ pub use shadow::Shadow; pub use shell::Shell; pub use size::Size; pub use text::Text; +pub use theme::Theme; pub use transformation::Transformation; pub use vector::Vector; pub use widget::Widget; diff --git a/style/src/theme.rs b/core/src/theme.rs index 21ba2a37..21ba2a37 100644 --- a/style/src/theme.rs +++ b/core/src/theme.rs diff --git a/style/src/theme/palette.rs b/core/src/theme/palette.rs index 15a964cd..985a54a8 100644 --- a/style/src/theme/palette.rs +++ b/core/src/theme/palette.rs @@ -1,5 +1,5 @@ //! Define the colors of a theme. -use crate::core::{color, Color}; +use crate::{color, Color}; use once_cell::sync::Lazy; use palette::color_difference::Wcag21RelativeContrast; |