From 87e7567b7b020808d51f66a1fb51644073852068 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 13 Sep 2023 15:33:57 +0200 Subject: [PATCH] feat(widget): add `divider::vertical` variants --- src/widget/mod.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 19517cf1..b49e5465 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -69,6 +69,29 @@ pub mod divider { horizontal_rule(10).style(crate::theme::Rule::HeavyDivider) } } + + /// Vertical variant of a divider. + pub mod vertical { + use iced::widget::{vertical_rule, Rule}; + + /// Vertical divider with default thickness + #[must_use] + pub fn default() -> Rule { + vertical_rule(1).style(crate::theme::Rule::Default) + } + + /// Vertical divider with light thickness + #[must_use] + pub fn light() -> Rule { + vertical_rule(4).style(crate::theme::Rule::LightDivider) + } + + /// Vertical divider with heavy thickness. + #[must_use] + pub fn heavy() -> Rule { + vertical_rule(10).style(crate::theme::Rule::HeavyDivider) + } + } } pub mod flex_row;