Skip to content

Commit 66b2c14

Browse files
committed
add tray doc
1 parent e99f598 commit 66b2c14

File tree

4 files changed

+175
-2
lines changed

4 files changed

+175
-2
lines changed

data/doc/4.widgets/5.box/1.text.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Plain text.
44

55
This widget can only be as a stand alone widget, it should be contained with in a `Box`.
66

7-
Ring provide one preset `time`.
7+
Text provide one preset `time`.
88

99
```json
1010
{

data/doc/4.widgets/5.box/2.tray.md

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Text
2+
3+
Tray widget.
4+
5+
This widget can only be as a stand alone widget, it should be contained with in a `Box`.
6+
7+
```json
8+
{
9+
"name": "tray",
10+
"edge": "bottom",
11+
"position": "left",
12+
"monitor": "HDMI-A-1",
13+
"layer": "overlay",
14+
"widget": {
15+
"type": "box",
16+
"frame_rate": 144,
17+
"align": "center_right",
18+
"widgets": [
19+
{
20+
"index": [-1, -1],
21+
"widget": {
22+
"type": "tray"
23+
}
24+
}
25+
]
26+
}
27+
}
28+
```
29+
30+
## `icon_size`
31+
32+
Tray icon size.
33+
34+
_Type: `int`_
35+
_Default: `20`_
36+
37+
## `tray_gap`
38+
39+
Gap between each tray item.
40+
41+
_Type: `integer`_
42+
\_Default: `2`
43+
44+
## `grid_align`
45+
46+
Align of the grid.
47+
48+
Enum:
49+
50+
```json
51+
[
52+
"top_left",
53+
"top_center",
54+
"top_right",
55+
"center_left,",
56+
"center_center",
57+
"center_right",
58+
"bottom_left",
59+
"bottom_center",
60+
"bottom_right"
61+
]
62+
```
63+
64+
_Type: `string`_
65+
_Default: `top_left`_
66+
67+
## `header_menu_stack`
68+
69+
Header on the top or Menu on the top.
70+
71+
Enum:
72+
73+
```json
74+
["header_top", "menu_top"]
75+
```
76+
77+
_Type: `string`_
78+
_Default: `header_top`_
79+
80+
## `header_menu_align`
81+
82+
Align of the grid.
83+
84+
Enum:
85+
86+
```json
87+
["left", "right"]
88+
```
89+
90+
_Type: `string`_
91+
_Default: `left`_
92+
93+
## `header_draw_config`
94+
95+
### `font_pixel_height`
96+
97+
Font pixel height of the tray header.
98+
99+
_Type: `int`_
100+
_Default: `16`_
101+
102+
### `text_color`
103+
104+
Color with RGBA support.
105+
106+
_Type: `string`_
107+
_Default: `#FFF`_
108+
109+
## `menu_draw_config`
110+
111+
### `margin`
112+
113+
Horizontal & Vertical margin of each menu item.
114+
115+
_Type: `[i32; 2]`_
116+
_Default: `[12, 16]`_
117+
118+
### `font_pixel_height`
119+
120+
Font pixel height of the tray header.
121+
122+
_Type: `int`_
123+
_Default: `20`_
124+
125+
### `marker_size`
126+
127+
Marker(radio/check/...) pixel height.
128+
129+
_Type: `int`_
130+
_Default: `20`_
131+
132+
### `separator_height`
133+
134+
Separator pixel height.
135+
136+
_Type: `int`_
137+
_Default: `5`_
138+
139+
### `border_color`
140+
141+
Color with RGBA support.
142+
143+
_Type: `string`_
144+
_Default: `#FFF`_
145+
146+
### `text_color`
147+
148+
Color with RGBA support.
149+
150+
_Type: `string`_
151+
_Default: `#FFF`_
152+
153+
### `marker_color`
154+
155+
Color with RGBA support.
156+
157+
`null` represents, same as `text_color`.
158+
159+
_Type: `null | string`_
160+
_Default: `null`_

data/meta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"title":"🤷 What is this","name":"description","children":[],"path":"/doc/0.description.md","name_path":"description"},{"title":"📥 Installation","name":"installation","children":[],"path":"/doc/1.installation.md","name_path":"installation"},{"title":"⌨️ Command line usage","name":"cmd","children":[],"path":"/doc/2.cmd.md","name_path":"cmd"},{"title":"⚙️ Configuration","name":"basic_config","children":[],"path":"/doc/3.basic_config.md","name_path":"basic_config"},{"title":"🧱 Widgets","name":"widgets","children":[{"title":"Button","name":"button","children":[],"path":"/doc/4.widgets/0.button.md","name_path":"widgets/button"},{"title":"Slide","name":"slide","children":[],"path":"/doc/4.widgets/1.slide.md","name_path":"widgets/slide"},{"title":"Speaker","name":"speaker","children":[],"path":"/doc/4.widgets/2.speaker.md","name_path":"widgets/speaker"},{"title":"Microphone","name":"microphone","children":[],"path":"/doc/4.widgets/3.microphone.md","name_path":"widgets/microphone"},{"title":"Backlight","name":"backlight","children":[],"path":"/doc/4.widgets/4.backlight.md","name_path":"widgets/backlight"},{"title":"Box","name":"box","children":[{"title":"Ring","name":"ring","children":[],"path":"/doc/4.widgets/5.box/0.ring.md","name_path":"box/ring"},{"title":"Text","name":"text","children":[],"path":"/doc/4.widgets/5.box/1.text.md","name_path":"box/text"}],"path":"/doc/4.widgets/5.box/index.md","name_path":"widgets/box"},{"title":"Hyprland Workspace","name":"hyprland-workspace","children":[],"path":"/doc/4.widgets/6.hyprland-workspace.md","name_path":"widgets/hyprland-workspace"}],"path":"/doc/4.widgets/index.md","name_path":"widgets"}]
1+
[{"title":"🤷 What is this","name":"description","children":[],"path":"/doc/0.description.md","name_path":"description"},{"title":"📥 Installation","name":"installation","children":[],"path":"/doc/1.installation.md","name_path":"installation"},{"title":"⌨️ Command line usage","name":"cmd","children":[],"path":"/doc/2.cmd.md","name_path":"cmd"},{"title":"⚙️ Configuration","name":"basic_config","children":[],"path":"/doc/3.basic_config.md","name_path":"basic_config"},{"title":"🧱 Widgets","name":"widgets","children":[{"title":"Button","name":"button","children":[],"path":"/doc/4.widgets/0.button.md","name_path":"widgets/button"},{"title":"Slide","name":"slide","children":[],"path":"/doc/4.widgets/1.slide.md","name_path":"widgets/slide"},{"title":"Speaker","name":"speaker","children":[],"path":"/doc/4.widgets/2.speaker.md","name_path":"widgets/speaker"},{"title":"Microphone","name":"microphone","children":[],"path":"/doc/4.widgets/3.microphone.md","name_path":"widgets/microphone"},{"title":"Backlight","name":"backlight","children":[],"path":"/doc/4.widgets/4.backlight.md","name_path":"widgets/backlight"},{"title":"Box","name":"box","children":[{"title":"Ring","name":"ring","children":[],"path":"/doc/4.widgets/5.box/0.ring.md","name_path":"box/ring"},{"title":"Text","name":"text","children":[],"path":"/doc/4.widgets/5.box/1.text.md","name_path":"box/text"},{"title":"Text","name":"tray","children":[],"path":"/doc/4.widgets/5.box/2.tray.md","name_path":"box/tray"}],"path":"/doc/4.widgets/5.box/index.md","name_path":"widgets/box"},{"title":"Hyprland Workspace","name":"hyprland-workspace","children":[],"path":"/doc/4.widgets/6.hyprland-workspace.md","name_path":"widgets/hyprland-workspace"}],"path":"/doc/4.widgets/index.md","name_path":"widgets"}]

src/app/box/tray/page.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import { get_file_under_data } from '@/lib/local_util'
3+
import MarkdownContent from '@/widgets/md/md_content'
4+
import { readFileSync } from 'fs'
5+
import '@/app/md.css'
6+
7+
export default async function Page() {
8+
const path = get_file_under_data('/doc/4.widgets/5.box/2.tray.md')
9+
const content = readFileSync(path).toString()
10+
return (
11+
<MarkdownContent content={content} />
12+
)
13+
}

0 commit comments

Comments
 (0)