repose_material/material3/
divider.rs1#![allow(non_snake_case)]
2
3
4use repose_core::*;
5use repose_ui::{
6 Box,
7};
8
9use super::*;
10
11#[derive(Clone, Debug)]
13pub struct DividerConfig {
14 pub modifier: Modifier,
15 pub thickness: f32,
16 pub color: Color,
17}
18
19impl Default for DividerConfig {
20 fn default() -> Self {
21 Self {
22 modifier: Modifier::new(),
23 thickness: DividerDefaults::THICKNESS,
24 color: DividerDefaults::color(),
25 }
26 }
27}
28
29pub fn HorizontalDivider(config: DividerConfig) -> View {
32 Box(Modifier::new()
33 .min_width(200.0)
34 .height(config.thickness)
35 .background(config.color)
36 .then(config.modifier))
37}
38
39#[deprecated(since = "0.19.5", note = "renamed to HorizontalDivider")]
40pub fn Divider(config: DividerConfig) -> View {
41 HorizontalDivider(config)
42}
43
44pub fn VerticalDivider(config: DividerConfig) -> View {
46 Box(Modifier::new()
47 .width(config.thickness)
48 .fill_max_height()
49 .background(config.color)
50 .then(config.modifier))
51}