Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit afb1f66

Browse files
committed
box index
1 parent ea07d01 commit afb1f66

File tree

1 file changed

+54
-58
lines changed

1 file changed

+54
-58
lines changed

data/doc/4.widgets/5.box/index.md

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
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

6442
Gap 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

Comments
 (0)