From 8c1891a12efb06aebe778accc03e4d186189af2b Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sun, 16 Feb 2025 19:14:39 +0100 Subject: [PATCH] Stretch widgets over the whole window To make things more accessible on mobile (nobody wants to try to "aim" for the buttons") and also not waste screen space on other platforms we stretch all widgets to match the window size. --- scenes/main.tscn | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scenes/main.tscn b/scenes/main.tscn index 98b6aac..5a3b73c 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -18,11 +18,9 @@ script = ExtResource("1_8bx00") [node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 @@ -48,16 +46,20 @@ layout_mode = 2 color = Color(0, 0, 0, 1) [node name="MorseButton" type="Button" parent="VBoxContainer"] -custom_minimum_size = Vector2(0, 100) layout_mode = 2 +size_flags_vertical = 3 +size_flags_stretch_ratio = 2.0 text = "MORSE" [node name="WavButton" type="Button" parent="VBoxContainer"] layout_mode = 2 +size_flags_vertical = 3 text = "Write Wav" [node name="ResetButton" type="Button" parent="VBoxContainer"] layout_mode = 2 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.5 text = "Reset" [node name="Player" type="AudioStreamPlayer" parent="."]