diff options
| -rw-r--r-- | option_set/option_set_list.gd | 16 | ||||
| -rw-r--r-- | themes/dark.tres | 8 |
2 files changed, 18 insertions, 6 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 diff --git a/themes/dark.tres b/themes/dark.tres index 05de2a0..875ee21 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=16 format=2] +[gd_resource type="Theme" load_steps=17 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] @@ -36,6 +36,11 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxEmpty" id=5] +[sub_resource type="StyleBoxEmpty" id=21] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 15.0 + [sub_resource type="StyleBoxFlat" id=9] content_margin_left = 10.0 content_margin_right = 10.0 @@ -105,6 +110,7 @@ ItemList/fonts/font = ExtResource( 2 ) ItemList/styles/bg = SubResource( 5 ) ItemList/styles/selected = SubResource( 4 ) ItemList/styles/selected_focus = SubResource( 4 ) +Label/styles/normal = SubResource( 21 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null |
