Center the legal consent row instead of left-aligning it
Wrapped the row in a CenterContainer so the checkbox+text sit centered under the field column instead of hugging the left edge. Had to drop the RichTextLabel's EXPAND_FILL (meaningless inside a CenterContainer, which never stretches its child) in favor of an explicit 480px minimum width - without one, the label collapsed toward zero width and wrapped character-by-character, which is what the first attempt at this actually rendered as before I caught it. Verified with a direct coordinate check: the row's horizontal center now matches the confirm-password field's center exactly (delta 0.0).
This commit is contained in:
@@ -364,13 +364,14 @@ func _add_legal_consent(parent: VBoxContainer) -> CheckBox:
|
|||||||
parent.add_child(check)
|
parent.add_child(check)
|
||||||
|
|
||||||
var margin := MarginContainer.new()
|
var margin := MarginContainer.new()
|
||||||
margin.add_theme_constant_override("margin_left", 6)
|
|
||||||
margin.add_theme_constant_override("margin_top", 8)
|
margin.add_theme_constant_override("margin_top", 8)
|
||||||
margin.add_theme_constant_override("margin_bottom", 8)
|
margin.add_theme_constant_override("margin_bottom", 8)
|
||||||
parent.add_child(margin)
|
parent.add_child(margin)
|
||||||
|
var center := CenterContainer.new()
|
||||||
|
margin.add_child(center)
|
||||||
var row := HBoxContainer.new()
|
var row := HBoxContainer.new()
|
||||||
row.add_theme_constant_override("separation", 12)
|
row.add_theme_constant_override("separation", 12)
|
||||||
margin.add_child(row)
|
center.add_child(row)
|
||||||
|
|
||||||
var square := Panel.new()
|
var square := Panel.new()
|
||||||
square.custom_minimum_size = Vector2(20, 20)
|
square.custom_minimum_size = Vector2(20, 20)
|
||||||
@@ -391,7 +392,7 @@ func _add_legal_consent(parent: VBoxContainer) -> CheckBox:
|
|||||||
consent_text.fit_content = true
|
consent_text.fit_content = true
|
||||||
consent_text.scroll_active = false
|
consent_text.scroll_active = false
|
||||||
consent_text.meta_underlined = false
|
consent_text.meta_underlined = false
|
||||||
consent_text.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
consent_text.custom_minimum_size = Vector2(480, 0)
|
||||||
consent_text.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
consent_text.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||||
consent_text.add_theme_font_override("normal_font", Brand.font)
|
consent_text.add_theme_font_override("normal_font", Brand.font)
|
||||||
consent_text.add_theme_font_size_override("normal_font_size", 13)
|
consent_text.add_theme_font_size_override("normal_font_size", 13)
|
||||||
|
|||||||
Reference in New Issue
Block a user