From fd0fa8bebfdcd77177c58e68b8a742ab5a338f17 Mon Sep 17 00:00:00 2001 From: dam Date: Sun, 10 Apr 2022 07:47:01 +0000 Subject: Added content margin on option_set_list items. --- option_set/option_set_list.gd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'option_set/option_set_list.gd') diff --git a/option_set/option_set_list.gd b/option_set/option_set_list.gd index 21692dd..fda2c04 100644 --- a/option_set/option_set_list.gd +++ b/option_set/option_set_list.gd @@ -69,22 +69,28 @@ func _init(): func _ready(): + var button_style := get_stylebox("pressed", "Button") + var label_style := get_stylebox("normal", "Label") + normal_style = StyleBoxFlat.new() normal_style.border_width_bottom = border_size normal_style.border_color = Color.white * 0.333 normal_style.bg_color = Color.transparent + normal_style.content_margin_left = label_style.content_margin_left + normal_style.content_margin_top = label_style.content_margin_top + normal_style.content_margin_right = label_style.content_margin_right - selected_style = StyleBoxFlat.new() - var button_style := get_stylebox("pressed", "Button") var bg_color := button_style.bg_color as Color var corner_radius := button_style.corner_radius_top_right as int -# selected_style.border_width_bottom = border_size -# selected_style.border_color = bg_color.lightened(0.333) + selected_style = StyleBoxFlat.new() selected_style.bg_color = bg_color selected_style.corner_radius_top_left = corner_radius selected_style.corner_radius_top_right = corner_radius selected_style.corner_radius_bottom_right = corner_radius selected_style.corner_radius_bottom_left = corner_radius + selected_style.content_margin_left = label_style.content_margin_left + selected_style.content_margin_top = label_style.content_margin_top + selected_style.content_margin_right = label_style.content_margin_right func mark_as_dirty(): @@ -147,7 +153,7 @@ func build_labels(): var label := Label.new() label.autowrap = autowrap label.anchor_right = 1.0 - label.valign = Label.VALIGN_CENTER + label.valign = Label.VALIGN_TOP labels.add_child(label) delta -= 1 -- cgit v1.2.3