aboutsummaryrefslogtreecommitdiff
path: root/option_set
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-04-10 07:47:01 +0000
committerdam <dam@gudinoff>2022-04-10 07:47:01 +0000
commitfd0fa8bebfdcd77177c58e68b8a742ab5a338f17 (patch)
tree580048bc75eaf4b69c54956f7e6c0d2bcc80cf17 /option_set
parent8146ae8e43a26787159d5840bae876d79112bd44 (diff)
downloadsurgery-log-fd0fa8bebfdcd77177c58e68b8a742ab5a338f17.tar.zst
surgery-log-fd0fa8bebfdcd77177c58e68b8a742ab5a338f17.zip
Added content margin on option_set_list items.
Diffstat (limited to 'option_set')
-rw-r--r--option_set/option_set_list.gd16
1 files changed, 11 insertions, 5 deletions
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