diff options
author | 2024-07-20 15:54:02 +0200 | |
---|---|---|
committer | 2024-07-20 15:54:02 +0200 | |
commit | 58f361d6806084c121c72e8752274c1cdf72fefc (patch) | |
tree | 4bd6b37635c0a327b8ffde611158adc41d2ec8c0 /widget | |
parent | 05884870fcca61849d8aa35cade354a192621092 (diff) | |
download | iced-58f361d6806084c121c72e8752274c1cdf72fefc.tar.gz iced-58f361d6806084c121c72e8752274c1cdf72fefc.tar.bz2 iced-58f361d6806084c121c72e8752274c1cdf72fefc.zip |
Introduce `container::dark` style
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/container.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/widget/src/container.rs b/widget/src/container.rs index d65bb086..b991e0f1 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -10,8 +10,9 @@ use crate::core::renderer; use crate::core::widget::tree::{self, Tree}; use crate::core::widget::{self, Operation}; use crate::core::{ - self, Background, Clipboard, Color, Element, Layout, Length, Padding, - Pixels, Point, Rectangle, Shadow, Shell, Size, Theme, Vector, Widget, + self, color, Background, Clipboard, Color, Element, Layout, Length, + Padding, Pixels, Point, Rectangle, Shadow, Shell, Size, Theme, Vector, + Widget, }; use crate::runtime::task::{self, Task}; @@ -654,3 +655,12 @@ pub fn bordered_box(theme: &Theme) -> Style { ..Style::default() } } + +/// A [`Container`] with a dark background and white text. +pub fn dark(_theme: &Theme) -> Style { + Style { + background: Some(color!(0x333333).into()), + text_color: Some(Color::WHITE), + ..Style::default() + } +} |