File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,18 @@ pub fn (mut ts TextBoxStyle) from_toml(a toml.Any) {
41
41
ts.bg_radius = a.value ('bg_radius' ).f32 ()
42
42
ts.bg_color = HexColor (a.value ('bg_color' ).string ()).color ()
43
43
ts.text_color = HexColor (a.value ('text_color' ).string ()).color ()
44
- if font_name := a.value_opt ('text_font_name' ) { ts.text_font_name = font_name.string () }
45
- if size := a.value_opt ('text_size' ) { ts.text_size = size.int () }
46
- if align := a.value_opt ('text_align' ) { ts.text_align = unsafe { TextHorizontalAlign (align.int ()) } }
47
- if vertical_align := a.value_opt ('text_vertical_align' ) { ts.text_vertical_align = unsafe { TextVerticalAlign (vertical_align.int ()) } }
44
+ if font_name := a.value_opt ('text_font_name' ) {
45
+ ts.text_font_name = font_name.string ()
46
+ }
47
+ if size := a.value_opt ('text_size' ) {
48
+ ts.text_size = size.int ()
49
+ }
50
+ if align := a.value_opt ('text_align' ) {
51
+ ts.text_align = unsafe { TextHorizontalAlign (align.int ()) }
52
+ }
53
+ if vertical_align := a.value_opt ('text_vertical_align' ) {
54
+ ts.text_vertical_align = unsafe { TextVerticalAlign (vertical_align.int ()) }
55
+ }
48
56
}
49
57
50
58
fn (mut t TextBox) load_style () {
Original file line number Diff line number Diff line change @@ -66,4 +66,4 @@ pub fn (mut w Window) apply_style() {
66
66
wdgt.load_style ()
67
67
}
68
68
}
69
- }
69
+ }
You can’t perform that action at this time.
0 commit comments