Skip to content

Commit b2aa38f

Browse files
Fix reset button position (#70)
1 parent 9ede032 commit b2aa38f

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/ui_widgets/setting_frame.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ func _ready() -> void:
9797
if type != Type.NONE:
9898
widget.reset_size()
9999
reset_button.tooltip_text = Translator.translate("Reset to default")
100-
reset_button.position = Vector2(size.x - 24, 4)
100+
reset_button.set_anchors_and_offsets_preset(Control.PRESET_CENTER_RIGHT)
101101
reset_button.pressed.connect(_on_reset_button_pressed)
102102
update_widgets()
103103

104104
func _on_resized() -> void:
105105
widget.position = Vector2(size.x - panel_width, 3)
106-
reset_button.position = Vector2(size.x - 24, 4)
106+
reset_button.set_anchors_and_offsets_preset(Control.PRESET_CENTER_RIGHT)
107107
queue_redraw()
108108

109109
func _on_reset_button_pressed() -> void:

src/ui_widgets/setting_frame.tscn

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
[node name="SettingFrame" type="Control"]
77
custom_minimum_size = Vector2(0, 28)
88
layout_mode = 3
9-
anchors_preset = 10
109
anchor_right = 1.0
10+
offset_bottom = 24.0
1111
grow_horizontal = 2
1212
focus_mode = 1
1313
mouse_filter = 1
1414
script = ExtResource("1_p1ngn")
1515

1616
[node name="ResetButton" type="Button" parent="."]
17-
layout_mode = 0
18-
offset_left = 1000.0
19-
offset_top = 3.0
20-
offset_right = 1024.0
21-
offset_bottom = 27.0
17+
layout_mode = 1
18+
anchors_preset = -1
19+
anchor_left = 1.0
20+
anchor_right = 1.0
21+
offset_left = -24.0
22+
offset_bottom = 24.0
23+
grow_horizontal = 0
2224
size_flags_horizontal = 10
2325
size_flags_vertical = 4
2426
focus_mode = 0

0 commit comments

Comments
 (0)