Introduce container::dark style

This commit is contained in:
Héctor Ramón Jiménez 2024-07-20 15:54:02 +02:00
parent 05884870fc
commit 58f361d680
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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()
}
}