4 static func inline(style: Dictionary) -> StyleBoxFlat:
5 var scale: float = DialogicUtil.get_editor_scale()
6 var s := StyleBoxFlat.new()
7 for property in style.keys():
10 s.set('border_width_left', style[property] * scale)
12 var radius: float = style[property] * scale
13 s.set('corner_radius_top_left', radius)
14 s.set('corner_radius_top_right', radius)
15 s.set('corner_radius_bottom_left', radius)
16 s.set('corner_radius_bottom_right', radius)
18 if typeof(style[property]) == TYPE_STRING and style[property] == "none":
19 s.set('draw_center', false)
21 s.set('bg_color', style[property])
23 var width: float = style[property] * scale
24 s.set('border_width_left', width)
25 s.set('border_width_right', width)
26 s.set('border_width_top', width)
27 s.set('border_width_bottom', width)
29 s.set('border_color', style[property])
31 var value_v: float = 0.0
32 var value_h: float = 0.0
33 if style[property] is int:
34 value_v = style[property] * scale
37 value_v = style[property][0] * scale
38 value_h = style[property][1] * scale
39 s.set('content_margin_top', value_v)
40 s.set('content_margin_bottom', value_v)
41 s.set('content_margin_left', value_h)
42 s.set('content_margin_right', value_h)
44 s.set('content_margin_right', style[property] * scale)
46 s.set('content_margin_left', style[property] * scale)