summaryrefslogtreecommitdiffstats
path: root/widget/src/container.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2024-09-02 11:59:35 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2024-09-02 11:59:35 +0200
commitfeff4d1cba1766a0e4901865f268cc90e7618c62 (patch)
treeac75356636b908792d3a903871904cebf90b76e6 /widget/src/container.rs
parent0dcec519be23da6d3bc409dbf7ac65407d59dc12 (diff)
downloadiced-feff4d1cba1766a0e4901865f268cc90e7618c62.tar.gz
iced-feff4d1cba1766a0e4901865f268cc90e7618c62.tar.bz2
iced-feff4d1cba1766a0e4901865f268cc90e7618c62.zip
Introduce `container::background` style helper
Diffstat (limited to '')
-rw-r--r--widget/src/container.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/widget/src/container.rs b/widget/src/container.rs
index ba315741..7eb50120 100644
--- a/widget/src/container.rs
+++ b/widget/src/container.rs
@@ -629,6 +629,11 @@ pub fn transparent<Theme>(_theme: &Theme) -> Style {
Style::default()
}
+/// A [`Container`] with the given [`Background`].
+pub fn background(background: impl Into<Background>) -> Style {
+ Style::default().background(background)
+}
+
/// A rounded [`Container`] with a background.
pub fn rounded_box(theme: &Theme) -> Style {
let palette = theme.extended_palette();