1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
use blaeck::prelude::*;
pub fn build_ui() -> Element {
element! {
Box(flex_direction: FlexDirection::Column, padding: 1.0) {
Text(content: "Enhanced Border Styling", bold: true, color: Color::Cyan)
Text(content: "")
// Per-side colors
Text(content: "Per-Side Border Colors:", bold: true)
Box(flex_direction: FlexDirection::Row, gap: 2.0) {
Box(
border_style: BorderStyle::Single,
border_colors: BorderColors {
top: Some(Color::Red),
bottom: Some(Color::Blue),
left: Some(Color::Green),
right: Some(Color::Yellow),
},
padding: 1.0,
width: 20.0,
height: 5.0
) {
Text(content: "4 colors!")
}
Box(
border_style: BorderStyle::Double,
border_colors: BorderColors {
top: Some(Color::Magenta),
bottom: Some(Color::Magenta),
left: Some(Color::Cyan),
right: Some(Color::Cyan),
},
padding: 1.0,
width: 20.0,
height: 5.0
) {
Text(content: "H/V colors")
}
}
Text(content: "")
// Partial borders
Text(content: "Partial Borders:", bold: true)
Box(flex_direction: FlexDirection::Row, gap: 2.0) {
Box(
border_style: BorderStyle::Single,
border_sides: Some(BorderSides::horizontal()),
border_color: Some(Color::Green),
padding: 1.0,
width: 18.0,
height: 4.0
) {
Text(content: "Top & Bottom")
}
Box(
border_style: BorderStyle::Single,
border_sides: Some(BorderSides::vertical()),
border_color: Some(Color::Blue),
padding: 1.0,
width: 18.0,
height: 4.0
) {
Text(content: "Left & Right")
}
Box(
border_style: BorderStyle::Bold,
border_sides: Some(BorderSides::top_only()),
border_color: Some(Color::Yellow),
padding: 1.0,
width: 18.0,
height: 4.0
) {
Text(content: "Top Only")
}
Box(
border_style: BorderStyle::Bold,
border_sides: Some(BorderSides::bottom_only()),
border_color: Some(Color::Magenta),
padding: 1.0,
width: 18.0,
height: 4.0
) {
Text(content: "Bottom Only")
}
}
Text(content: "")
// Dim borders
Text(content: "Dim Borders:", bold: true)
Box(flex_direction: FlexDirection::Row, gap: 2.0) {
Box(
border_style: BorderStyle::Round,
border_color: Some(Color::White),
padding: 1.0,
width: 20.0
) {
Text(content: "Normal border")
}
Box(
border_style: BorderStyle::Round,
border_color: Some(Color::White),
border_dim: true,
padding: 1.0,
width: 20.0
) {
Text(content: "Dim border")
}
}
Text(content: "")
// Combined features
Text(content: "Combined Features:", bold: true)
Box(
border_style: BorderStyle::Double,
border_sides: Some(BorderSides { top: true, bottom: true, left: false, right: false }),
border_colors: BorderColors {
top: Some(Color::Cyan),
bottom: Some(Color::Magenta),
..Default::default()
},
padding: 1.0,
width: 40.0
) {
Text(content: "Horizontal borders with gradient effect")
}
}
}
}