diff --git a/scripts/ui/login_screen.gd b/scripts/ui/login_screen.gd index 7f0c399..3ccb6af 100644 --- a/scripts/ui/login_screen.gd +++ b/scripts/ui/login_screen.gd @@ -196,16 +196,27 @@ func _build_ui() -> void: auth_panel.add_child(scroll) panel_gutter = MarginContainer.new() panel_gutter.size_flags_horizontal = Control.SIZE_EXPAND_FILL + panel_gutter.size_flags_vertical = Control.SIZE_EXPAND_FILL panel_gutter.add_theme_constant_override("margin_right", 28) scroll.add_child(panel_gutter) panel_content = VBoxContainer.new() panel_content.size_flags_horizontal = Control.SIZE_EXPAND_FILL - panel_content.add_theme_constant_override("separation", 16) + panel_content.size_flags_vertical = Control.SIZE_EXPAND_FILL + panel_content.add_theme_constant_override("separation", 24) panel_gutter.add_child(panel_content) + # main_column holds everything except the legal footer and is the part + # that should center vertically when a view (e.g. login) is shorter than + # the panel - the footer stays pinned to the very bottom either way. + var main_column := VBoxContainer.new() + main_column.size_flags_vertical = Control.SIZE_EXPAND_FILL + main_column.alignment = BoxContainer.ALIGNMENT_CENTER + main_column.add_theme_constant_override("separation", 16) + panel_content.add_child(main_column) + var panel_header := HBoxContainer.new() panel_header.add_theme_constant_override("separation", 18) - panel_content.add_child(panel_header) + main_column.add_child(panel_header) var small_icon := TextureRect.new() small_icon.texture = Brand.ranaze_mark_texture() small_icon.custom_minimum_size = Vector2(72, 72) @@ -229,14 +240,14 @@ func _build_ui() -> void: reset_view = _build_reset_view() steam_view = _build_steam_view() for view in [login_view, register_view, reset_view, steam_view]: - panel_content.add_child(view) + main_column.add_child(view) message_label = Label.new() message_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART message_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER message_label.add_theme_font_size_override("font_size", 14) message_label.add_theme_font_override("font", Brand.font) - panel_content.add_child(message_label) + main_column.add_child(message_label) var legal_footer := HBoxContainer.new() legal_footer.alignment = BoxContainer.ALIGNMENT_CENTER legal_footer.add_theme_constant_override("separation", 12)