Implement responsive profile and account data controls
This commit is contained in:
@@ -28,6 +28,12 @@ func _initialize() -> void:
|
||||
_assert(light_card.border_color.is_equal_approx(Brand.ROYAL_BLUE), "active light cards should use the primary blue border")
|
||||
var light_field := Brand.field_box(false)
|
||||
_assert(light_field.border_color.is_equal_approx(Brand.LIGHT_BORDER), "light fields should use the semantic cool-gray border")
|
||||
var explicitly_light_panel := PanelContainer.new()
|
||||
explicitly_light_panel.add_theme_stylebox_override("panel", Brand.content_card_box(false, false))
|
||||
root.add_child(explicitly_light_panel)
|
||||
Style.refresh_tree(root, true)
|
||||
var preserved_light_box := explicitly_light_panel.get_theme_stylebox("panel") as StyleBoxFlat
|
||||
_assert(preserved_light_box.bg_color.is_equal_approx(Color.WHITE), "a screen's explicit light styles should not be translated back to dark")
|
||||
var theme_toggle := Button.new()
|
||||
Brand.set_theme_toggle_icon(theme_toggle, true)
|
||||
_assert(theme_toggle.text.is_empty() and theme_toggle.icon == Brand.SUN_ICON, "dark mode should use the bundled sun icon")
|
||||
@@ -50,6 +56,11 @@ func _initialize() -> void:
|
||||
var auth_field: LineEdit = login._add_field(field_parent, "Email", "[email protected]")
|
||||
_assert(auth_field.caret_blink, "authentication fields should display a blinking caret")
|
||||
_assert(is_equal_approx(auth_field.caret_blink_interval, 0.5), "authentication field caret should blink at a visible interval")
|
||||
login._style_auth_field(auth_field, false)
|
||||
var editable_box := auth_field.get_theme_stylebox("normal") as StyleBoxFlat
|
||||
var read_only_box := auth_field.get_theme_stylebox("read_only") as StyleBoxFlat
|
||||
_assert(read_only_box.bg_color.is_equal_approx(editable_box.bg_color), "authentication fields should retain their surface while a request is pending")
|
||||
_assert(is_equal_approx(read_only_box.content_margin_left, editable_box.content_margin_left), "authentication fields should retain their text inset while a request is pending")
|
||||
login.free()
|
||||
theme_toggle.free()
|
||||
|
||||
|
||||
@@ -72,6 +72,27 @@ func _run() -> void:
|
||||
var question_bank_nav := main_screen.sidebar.find_child("NavQuestionBank", true, false) as Button
|
||||
_assert(question_bank_nav != null and question_bank_nav.text == "Question Bank", "the Practice navigation item should be replaced by Question Bank")
|
||||
_assert(main_screen.sidebar.find_child("NavPractice", true, false) == null, "the sidebar should not retain a Practice navigation item")
|
||||
var profile_nav := main_screen.sidebar.find_child("NavPerformance", true, false) as Button
|
||||
var settings_nav := main_screen.sidebar.find_child("NavSettings", true, false) as Button
|
||||
_assert(profile_nav != null and settings_nav != null and profile_nav.get_index() + 1 == settings_nav.get_index(), "Profile should sit directly above Settings in the lower navigation group")
|
||||
var theme_service = root.get_node("UIThemeService")
|
||||
var prior_dark_mode: bool = theme_service.is_dark_mode()
|
||||
theme_service.set_dark_mode(true)
|
||||
await process_frame
|
||||
theme_service.set_dark_mode(false)
|
||||
await process_frame
|
||||
var dashboard = main_screen.screens.get("dashboard")
|
||||
var dashboard_card := dashboard.metric_grid.get_parent() as PanelContainer
|
||||
var dashboard_box := dashboard_card.get_theme_stylebox("panel") as StyleBoxFlat
|
||||
_assert(dashboard_box.bg_color.is_equal_approx(Color.WHITE), "dashboard cards should remain light after the shell refresh")
|
||||
var simulations = main_screen.screens.get("simulation_history")
|
||||
var simulation_box := simulations.active_section.get_theme_stylebox("panel") as StyleBoxFlat
|
||||
_assert(simulation_box.bg_color.is_equal_approx(simulations._section_box(false).bg_color), "exam simulation panels should remain light after the shell refresh")
|
||||
var notes_screen = main_screen.screens.get("notes")
|
||||
var notes_box := notes_screen.notes_editor.editor.get_theme_stylebox("normal") as StyleBoxFlat
|
||||
_assert(notes_box.bg_color.is_equal_approx(Color.WHITE), "the Notes editor should remain light after the shell refresh")
|
||||
theme_service.set_dark_mode(prior_dark_mode)
|
||||
await process_frame
|
||||
|
||||
host.queue_free()
|
||||
await process_frame
|
||||
|
||||
Reference in New Issue
Block a user