Skip to content

Commit

Permalink
formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
squidink7 committed Jan 19, 2024
1 parent 35f2701 commit be4df07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/textbox_style.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ pub fn (mut ts TextBoxStyle) from_toml(a toml.Any) {
ts.bg_radius = a.value('bg_radius').f32()
ts.bg_color = HexColor(a.value('bg_color').string()).color()
ts.text_color = HexColor(a.value('text_color').string()).color()
if font_name := a.value_opt('text_font_name') { ts.text_font_name = font_name.string() }
if size := a.value_opt('text_size') { ts.text_size = size.int() }
if align := a.value_opt('text_align') { ts.text_align = unsafe { TextHorizontalAlign(align.int()) } }
if vertical_align := a.value_opt('text_vertical_align') { ts.text_vertical_align = unsafe { TextVerticalAlign(vertical_align.int()) } }
if font_name := a.value_opt('text_font_name') {
ts.text_font_name = font_name.string()
}
if size := a.value_opt('text_size') {
ts.text_size = size.int()
}
if align := a.value_opt('text_align') {
ts.text_align = unsafe { TextHorizontalAlign(align.int()) }
}
if vertical_align := a.value_opt('text_vertical_align') {
ts.text_vertical_align = unsafe { TextVerticalAlign(vertical_align.int()) }
}
}

fn (mut t TextBox) load_style() {
Expand Down
2 changes: 1 addition & 1 deletion src/window_style.v
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ pub fn (mut w Window) apply_style() {
wdgt.load_style()
}
}
}
}

0 comments on commit be4df07

Please sign in to comment.