From ce4db7cec8cd782fa1a07bac8cee57d726073435 Mon Sep 17 00:00:00 2001 From: hz Date: Sat, 25 Jul 2026 00:52:12 -0500 Subject: [PATCH] Remove the login panel scrollbar The auth panel was a fixed 710x820 (640x790 on narrower desktop windows) regardless of which view was showing, but Register and the Steam linking form need up to ~990px to lay out without scrolling - so the inner ScrollContainer was always kicking in for those views. - Tightened form spacing (_new_form separation 16->10, field height 68->56, panel_content separation 24->16, page margins 56->28) to shrink how much height each view actually needs. - Size the panel to the tallest view's real requirement (1000/1010), clamped to whatever height the window actually has so a short window shrinks the panel - and lets the ScrollContainer take over as a fallback - instead of the panel overflowing off-screen. Verified headlessly across 1920x1080, 1366x768, and a narrow compact-desktop width: no scrollbar in any mode at the two common resolutions, and the panel now stays within the window (falling back to scrolling only for the two tallest forms on the 768px-tall case, rather than clipping off both edges of the screen as a fixed height would have). --- scripts/ui/login_screen.gd | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/ui/login_screen.gd b/scripts/ui/login_screen.gd index 432f99f..7f0c399 100644 --- a/scripts/ui/login_screen.gd +++ b/scripts/ui/login_screen.gd @@ -124,8 +124,8 @@ func _build_ui() -> void: page_margin.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) page_margin.add_theme_constant_override("margin_left", 52) page_margin.add_theme_constant_override("margin_right", 52) - page_margin.add_theme_constant_override("margin_top", 56) - page_margin.add_theme_constant_override("margin_bottom", 56) + page_margin.add_theme_constant_override("margin_top", 28) + page_margin.add_theme_constant_override("margin_bottom", 28) add_child(page_margin) var columns := HBoxContainer.new() @@ -189,7 +189,7 @@ func _build_ui() -> void: panel_center.size_flags_vertical = Control.SIZE_EXPAND_FILL columns.add_child(panel_center) auth_panel = PanelContainer.new() - auth_panel.custom_minimum_size = Vector2(710, 820) + auth_panel.custom_minimum_size = Vector2(710, 1000) panel_center.add_child(auth_panel) var scroll := ScrollContainer.new() scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED @@ -200,7 +200,7 @@ func _build_ui() -> void: 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", 24) + panel_content.add_theme_constant_override("separation", 16) panel_gutter.add_child(panel_content) var panel_header := HBoxContainer.new() @@ -357,7 +357,7 @@ func _open_legal_document(kind: String) -> void: func _new_form() -> VBoxContainer: var form := VBoxContainer.new() - form.add_theme_constant_override("separation", 16) + form.add_theme_constant_override("separation", 10) return form @@ -388,7 +388,7 @@ func _add_field(parent: VBoxContainer, label_text: String, placeholder: String, input.secret = secret input.caret_blink = true input.caret_blink_interval = 0.5 - input.custom_minimum_size = Vector2(0, 68) + input.custom_minimum_size = Vector2(0, 56) input.add_theme_font_size_override("font_size", 17) input.add_theme_font_override("font", Brand.font) parent.add_child(input) @@ -487,6 +487,9 @@ func _update_responsive_layout() -> void: var layout_width := size.x if layout_width <= 0.0: layout_width = get_viewport_rect().size.x + var layout_height := size.y + if layout_height <= 0.0: + layout_height = get_viewport_rect().size.y var compact_desktop := layout_width < 900.0 var mobile_web := false if OS.has_feature("web"): @@ -505,7 +508,16 @@ func _update_responsive_layout() -> void: theme_button.custom_minimum_size = Vector2(44, 44) theme_button.position = Vector2(-58, 14) theme_button.add_theme_font_size_override("font_size", 20) - auth_panel.custom_minimum_size = Vector2(640, 790) if compact_desktop else Vector2(710, 820) + # 1000/1010 comfortably fits every view (login/register/reset/steam) + # without the inner ScrollContainer kicking in, on any window tall + # enough to hold it - but clamp to whatever height is actually + # available so a short window shrinks the panel (and lets the + # ScrollContainer take over) instead of the panel overflowing off + # the top/bottom of the screen. + var available_panel_height := layout_height - 56.0 + var target_height := 1010.0 if compact_desktop else 1000.0 + var panel_height := clampf(available_panel_height, 400.0, target_height) + auth_panel.custom_minimum_size = Vector2(640 if compact_desktop else 710, panel_height) panel_gutter.add_theme_constant_override("margin_right", 28) _apply_compact_scale(panel_content, 1.0) _apply_theme()