Reorder header theme and account controls

This commit is contained in:
hz
2026-07-18 15:01:04 -05:00
parent dca09d818f
commit c8c877a3a5
2 changed files with 15 additions and 13 deletions
+13 -13
View File
@@ -151,6 +151,19 @@ func _build_ui() -> void:
feedback_button.pressed.connect(open_feedback_dialog)
header.add_child(feedback_button)
theme_button = Button.new()
theme_button.tooltip_text = "Switch color theme"
theme_button.custom_minimum_size = Vector2(44, 44)
theme_button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
theme_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER
theme_button.alignment = HORIZONTAL_ALIGNMENT_CENTER
theme_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
theme_button.focus_mode = Control.FOCUS_NONE
theme_button.pressed.connect(theme_service.toggle_theme)
_style_shell_theme_button(theme_button)
header.add_child(theme_button)
_refresh_theme_button()
account_button = Button.new()
account_button.tooltip_text = "Open account menu"
account_button.custom_minimum_size = Vector2(44, 44)
@@ -169,19 +182,6 @@ func _build_ui() -> void:
_style_account_chevron(account_chevron_button)
header.add_child(account_chevron_button)
theme_button = Button.new()
theme_button.tooltip_text = "Switch color theme"
theme_button.custom_minimum_size = Vector2(44, 44)
theme_button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
theme_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER
theme_button.alignment = HORIZONTAL_ALIGNMENT_CENTER
theme_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
theme_button.focus_mode = Control.FOCUS_NONE
theme_button.pressed.connect(theme_service.toggle_theme)
_style_shell_theme_button(theme_button)
header.add_child(theme_button)
_refresh_theme_button()
var screens_container := MarginContainer.new()
screens_margin = screens_container
screens_host = screens_container
+2
View File
@@ -45,6 +45,8 @@ func _run() -> void:
_assert(main_screen.theme_button.custom_minimum_size == Vector2(44, 44), "the theme toggle should keep a stable square footprint")
_assert(main_screen.theme_button.size.x >= 44.0 and main_screen.theme_button.size.y >= 44.0, "the theme toggle should not collapse into an oval")
_assert(main_screen.theme_button.icon_alignment == HORIZONTAL_ALIGNMENT_CENTER, "the theme toggle icon should remain centered")
_assert(main_screen.theme_button.get_index() < main_screen.account_button.get_index(), "the theme toggle should appear before the account dropdown")
_assert(main_screen.account_chevron_button.get_index() == main_screen.account_button.get_index() + 1, "the account avatar and chevron should remain adjacent")
_assert(main_screen.header_panel.find_child("HeaderStats", true, false) == null, "the application header should not display rating or role labels")
_assert(not main_screen.account_chevron_button.visible, "nonessential account controls should collapse on phone-width headers")
var question_bank_nav := main_screen.sidebar.find_child("NavQuestionBank", true, false) as Button