diff --git a/src/menu/options/Key.gd b/src/menu/options/Key.gd index a3eaa81..a188e3a 100644 --- a/src/menu/options/Key.gd +++ b/src/menu/options/Key.gd @@ -41,15 +41,16 @@ func set_text(arg := text): var l = text.length() * font_width rect_min_size = Vector2(l + 3, 9) + rect_size = rect_min_size + var in_size = Vector2(l + 1, 7) if is_instance_valid(label): label.text = text label.rect_size = Vector2.ONE - if is_instance_valid(white): - white.rect_size = rect_min_size + white.rect_size = in_size if is_instance_valid(black): - black.rect_size = Vector2(l + 1, 7) + black.rect_size = rect_min_size update() diff --git a/src/menu/options/Key.tscn b/src/menu/options/Key.tscn index 5a1b427..c940679 100644 --- a/src/menu/options/Key.tscn +++ b/src/menu/options/Key.tscn @@ -5,35 +5,35 @@ [sub_resource type="DynamicFont" id=1] size = 5 -outline_size = 1 outline_color = Color( 0, 0, 0, 1 ) extra_spacing_top = -1 extra_spacing_bottom = -1 font_data = ExtResource( 1 ) [node name="Key" type="Control"] -margin_right = 8.0 -margin_bottom = 8.0 +margin_right = 21.0 +margin_bottom = 9.0 rect_min_size = Vector2( 21, 9 ) size_flags_vertical = 4 script = ExtResource( 2 ) action = "jump" -[node name="White" type="ColorRect" parent="."] +[node name="Black" type="ColorRect" parent="."] +modulate = Color( 0, 0, 0, 1 ) margin_right = 21.0 margin_bottom = 9.0 -[node name="Black" type="ColorRect" parent="."] -modulate = Color( 0, 0, 0, 1 ) +[node name="White" type="ColorRect" parent="."] margin_left = 1.0 margin_top = 1.0 margin_right = 20.0 margin_bottom = 8.0 [node name="Label" type="Label" parent="."] +modulate = Color( 0, 0, 0, 1 ) margin_left = 2.0 margin_top = 2.0 -margin_right = 20.0 +margin_right = 26.0 margin_bottom = 7.0 custom_fonts/font = SubResource( 1 ) text = "key"