1- # Box
1+ # WrapBox
22
3- A Grid Box act as a container for other specific widgets.
4- Current available elements:
5-
6- - Ring
7- - Text
3+ A Grid Box act as a container for other widgets.
84
95_ Example:_
106
117``` json
128{
13- "name" : " stats" ,
14- "edge" : " left" ,
9+ "name" : " time" ,
10+ "edge" : " bottom" ,
11+ "monitor" : " HDMI-A-1" ,
1512 "layer" : " overlay" ,
16- "frame_rate" : 144 ,
1713 "widget" : {
18- "type" : " box" ,
14+ "type" : " wrap- box" ,
1915 "widgets" : [
2016 {
2117 "index" : [-1 , -1 ],
2218 "widget" : {
23- "frame_rate" : 144 ,
24- "type" : " ring" ,
25- "prefix" : " RAM " ,
26- "preset" : " ram"
19+ "type" : " text" ,
20+ "fg_color" : " #FFFFFF" ,
21+ "font_size" : 30 ,
22+ "font_family" : " JetBrainsMono Nerd Font" ,
23+ "preset" : {
24+ "type" : " time" ,
25+ "format" : " %m-%d\n %H:%M"
26+ }
2727 }
2828 }
2929 ]
@@ -34,56 +34,35 @@ _Example:_
3434## ` type* `
3535
3636``` plaintext
37- const `box`
37+ const `wrap- box`
3838```
3939
40- ## ` frame_rate `
41-
42- Frame rate per second, won't hurt if over screen refresh rate.
43-
44- _ Type: ` int ` _
45- _ Default: ` 60 ` _
46-
47- ## ` transition_duration `
48-
49- Time cost of showing the widget from the edge.
50- Millisecond.
51-
52- _ Type: ` int ` _
53- _ Default: ` 100 ` _
54-
55- ## ` extra_trigger_size `
56-
57- Extra mouse event input region of the widget, if ` 0 ` then the widget won't be shown by mouse hover.
58-
59- _ Type: ` int | string ` _
60- _ Default: ` 5 ` _
61-
6240## ` gap `
6341
6442Gap between widgets in the grid.
6543
6644_ Type: ` int ` _
6745_ Default: ` 10 ` _
6846
69- ## ` widgets `
70-
71- Array of supported widgets and it's position in grid.
72-
73- _ Type: ` array ` _
74- _ Default: ` [] ` _
75-
76- ### ` index* `
77-
78- ` [x, y] ` position of the widget in grid, ` -1 ` means to append widget to the end of the grid.
79-
80- _ Type: ` [int, int] ` _
81-
82- ### ` widget* `
83-
84- Normal widget item, currently only support ` Ring ` and ` Text ` .
85-
86- _ Type: ` object ` _
47+ ## ` align `
48+
49+ Align of the items inside grid
50+
51+ ``` rust
52+ #[serde(rename_all = " snake_case" )]
53+ pub enum Align {
54+ #[default]
55+ TopLeft ,
56+ TopCenter ,
57+ TopRight ,
58+ CenterLeft ,
59+ CenterCenter ,
60+ CenterRight ,
61+ BottomLeft ,
62+ BottomCenter ,
63+ BottomRight ,
64+ }
65+ ```
8766
8867## ` outlook `
8968
@@ -102,10 +81,10 @@ const `window`
10281
10382#### ` margins `
10483
105- Tuple of 4 integers, left, top, right, bottom.
84+ left, top, right, bottom.
10685
107- _ Type: ` [int, int, int, int] ` _
108- _ Default: ` [5,5,5,5] ` _
86+ _ Type: ` object ` _
87+ _ Default: ` {} ` _
10988
11089#### ` color `
11190
@@ -126,3 +105,20 @@ _Default: `5`_
126105
127106_ Type: ` int ` _
128107_ Default: ` 15 ` _
108+
109+ ## ` widgets `
110+
111+ Array of supported widgets and it's position in grid.
112+
113+ _ Type: ` array ` _
114+ _ Default: ` [] ` _
115+
116+ ### ` index* `
117+
118+ ` [x, y] ` position of the widget in grid, ` -1 ` means to append widget to the end of the grid.
119+
120+ _ Type: ` [int, int] ` _
121+
122+ ### ` widget* `
123+
124+ _ Type: ` object ` _
0 commit comments