Skip to content

Commit aff0b93

Browse files
committed
update 1019
1 parent 0865a4b commit aff0b93

File tree

4 files changed

+69
-19
lines changed

4 files changed

+69
-19
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [GenUI Ignore](./gen/tutorials/ignore.md)
1414
- [Props Manual](./gen/tutorials/props/introduction.md)
1515
- [Type](./gen/tutorials/props/type.md)
16+
- [Named](./gen/tutorials/props/named.md)
1617
- [Font](./gen/tutorials/props/font.md)
1718
- [Text](./gen/tutorials/props/text.md)
1819
- [Background](./gen/tutorials/props/background.md)

src/gen/makepad/components/label.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,28 @@ live_design! {
1717
height: 100.0,
1818
width: Fill,
1919
spacing: 10.0,
20+
flow: Down,
2021
<Label>{
2122
text: "GLabel"
2223
}
23-
<GLabel>{
24-
text: "Hello, world! This is a long message, but I use wrap Word to wrap it!",
25-
height: 48.0,
26-
width: 120.0,
27-
wrap: Word,
28-
brightness: 1.5,
29-
margin: {left: 12.0},
30-
}
31-
<GLabel>{
32-
text: "bold, test bold!!",
33-
font_size: 12.0,
34-
padding: 16.0,
35-
color: #FF0000,
36-
font_family: dep("E:/Rust/try/makepad/Gen-UI/examples/gen_widget_example/resources/GoNotoKurrent-Bold.ttf"),
24+
<GHLayout>{
25+
height: Fit,
26+
width: Fill,
27+
spacing: 10.0,
28+
<GLabel>{
29+
text: "Hello, world! This is a long message, but I use wrap Word to wrap it!",
30+
height: Fit,
31+
width: 120.0,
32+
wrap: Word,
33+
margin: {left: 12.0},
34+
}
35+
<GLabel>{
36+
text: "test another font family!!",
37+
font_size: 12.0,
38+
padding: 16.0,
39+
color: #FF0000,
40+
font_family: dep("crate://self/resources/AlimamaFangYuanTiVF-Thin.ttf"),
41+
}
3742
}
3843
}
3944
}
@@ -45,19 +50,22 @@ live_design! {
4550
|--|--|--|--|
4651
|live|color|`Vec4`|The color of the label.|
4752
|live|font_size|`f64`|The size of the font used in the label.|
48-
|live|brightness|`f32`|The brightness level of the text.|
49-
|live|curve|`f32`|The curve factor of the text.|
53+
|live|brightness(unused)|`f32`|The brightness level of the text.|
54+
|live|curve(unused)|`f32`|The curve factor of the text.|
5055
|live|line_spacing|`f64`|The line spacing of the text.|
5156
|live|top_drop|`f64`|The top drop of the text.|
5257
|live|height_factor|`f64`|The height factor of the text.|
5358
|live|wrap|`TextWrap`|The text wrapping mode.|
5459
|live|font_family|`LiveDependency`|The font family of the text.|
5560
|live|visible|`bool`|Whether the label is visible.|
5661
|deref|draw_text|`DrawText`|The `DrawText` component used for drawing the text.|
57-
|walk|walk|`Walk`|The `Walk` component for positioning.|
62+
|walk|height|`Size`|The height of the label|
63+
|walk|width|`Size`|The width of the label|
64+
|walk|abs_pos|`Option<DVec2>`|abs position of the component|
65+
|walk|margin|`Margin`|the margin around the component|
5866
|live|align|`Align`|The alignment of the text.|
59-
|live|padding|`Padding`|The padding around the text.|
60-
|live|text|`RcStringMut`|The content of the label.|
67+
|live|padding|`Padding`|The padding around the text. default `0.0`|
68+
|live|text|`ArcStringMut`|The content of the label.|
6169

6270
## Event
6371

src/gen/tutorials/props/named.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Named
2+
3+
> 说明:
4+
>
5+
> 命名规则是属性命名的基础, 用于对属性命名进行规范化处理, 规则如下:
6+
> 1. 若无特殊情况属性命名必须依照基础命名原则
7+
> 2. 当出现基础命名不足够时采用基础组件命名法
8+
9+
## 基础组件命名法
10+
11+
基础组件命名法只有在出现基础命名不足够时进行使用, 它的原则很简单
12+
13+
即: `${base_ele}_${base_prop_name}`
14+
15+
例如:
16+
17+
当某个组件中已经有代表hover状态时的`hover_color`时,还需要对线条处于hover状态时定义颜色属性
18+
19+
那么这个新属性为: `stroke_hover_color`
20+
21+
## base ele
22+
23+
base ele指的是最基本的构成部分,他是所有其他组件的基础
24+
25+
- stroke: 线条
26+
- text: 文本
27+
-
28+
29+
## Color
30+
31+
### 基础命名说明
32+
33+
|命名|说明|
34+
|--|--|
35+
|background_color|背景色, 在任意具有区域化的组件中都应该含有|
36+
|color|文字颜色, 仅在带有文字的组件中含有|
37+
|stroke_color|线条颜色, 在含有线条的组件中使用, 例如图标|
38+
|hover_color|当hover时的颜色|
39+
|pressed_color|当pressed时的颜色|
40+
|border_color|边框颜色|
41+
|shadow_color|阴影颜色|

src/static/gen/components/label.png

1 KB
Loading

0 commit comments

Comments
 (0)