Merge pull request 'Fix login/calculator theme bugs, gate flashcard button, hide system label pre-answer' (#11) from main into production
Reviewed-on: admin/step3#11
This commit is contained in:
@@ -101,8 +101,8 @@ func refresh_theme_controls() -> void:
|
|||||||
return
|
return
|
||||||
var dark := UIThemeService.is_dark_mode()
|
var dark := UIThemeService.is_dark_mode()
|
||||||
add_theme_stylebox_override("panel", Brand.content_card_box(dark, true, Brand.ROYAL_BLUE))
|
add_theme_stylebox_override("panel", Brand.content_card_box(dark, true, Brand.ROYAL_BLUE))
|
||||||
display_label.add_theme_color_override("font_color", Brand.text_color(dark))
|
display_label.add_theme_color_override("font_color", Color.WHITE)
|
||||||
operation_label.add_theme_color_override("font_color", Brand.muted_color(dark))
|
operation_label.add_theme_color_override("font_color", Brand.muted_color(true))
|
||||||
for button in keypad_buttons:
|
for button in keypad_buttons:
|
||||||
var accent := Brand.ROYAL_BLUE if str(button.get_meta("calculator_token", "")) in ["+", "−", "×", "÷", "="] else Brand.SLATE
|
var accent := Brand.ROYAL_BLUE if str(button.get_meta("calculator_token", "")) in ["+", "−", "×", "÷", "="] else Brand.SLATE
|
||||||
button.add_theme_stylebox_override("normal", Brand.badge_box(dark, accent))
|
button.add_theme_stylebox_override("normal", Brand.badge_box(dark, accent))
|
||||||
|
|||||||
@@ -65,6 +65,13 @@ var compact_layout := false
|
|||||||
var layout_updating := false
|
var layout_updating := false
|
||||||
|
|
||||||
|
|
||||||
|
func _notification(what: int) -> void:
|
||||||
|
if what == NOTIFICATION_APPLICATION_FOCUS_OUT:
|
||||||
|
var focus_owner := get_viewport().gui_get_focus_owner()
|
||||||
|
if focus_owner != null:
|
||||||
|
focus_owner.release_focus()
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
auth_base_url = EndpointConfig.resolve(AUTH_BASE, "/api/Auth")
|
auth_base_url = EndpointConfig.resolve(AUTH_BASE, "/api/Auth")
|
||||||
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
@@ -851,7 +858,8 @@ func _on_steam_status(result: int, code: int, _headers: PackedStringArray, body:
|
|||||||
"requires_account":
|
"requires_account":
|
||||||
poll_timer.stop()
|
poll_timer.stop()
|
||||||
_close_steam_popup()
|
_close_steam_popup()
|
||||||
external_verified_email = str(data.get("email", ""))
|
var verified_email_value: Variant = data.get("email")
|
||||||
|
external_verified_email = "" if verified_email_value == null else str(verified_email_value)
|
||||||
steam_email_input.text = external_verified_email
|
steam_email_input.text = external_verified_email
|
||||||
steam_email_input.editable = external_verified_email.is_empty()
|
steam_email_input.editable = external_verified_email.is_empty()
|
||||||
_set_mode("steam")
|
_set_mode("steam")
|
||||||
|
|||||||
@@ -467,6 +467,7 @@ func _ready() -> void:
|
|||||||
content_margin.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
content_margin.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
content_margin.add_theme_constant_override("margin_left", 4)
|
content_margin.add_theme_constant_override("margin_left", 4)
|
||||||
content_margin.add_theme_constant_override("margin_right", 12)
|
content_margin.add_theme_constant_override("margin_right", 12)
|
||||||
|
content_margin.add_theme_constant_override("margin_top", 20)
|
||||||
question_scroll.add_child(content_margin)
|
question_scroll.add_child(content_margin)
|
||||||
|
|
||||||
question_content = VBoxContainer.new()
|
question_content = VBoxContainer.new()
|
||||||
@@ -1305,7 +1306,7 @@ func _load_question() -> void:
|
|||||||
if category_text.is_empty():
|
if category_text.is_empty():
|
||||||
category_text = str(question.get("system", "")).strip_edges()
|
category_text = str(question.get("system", "")).strip_edges()
|
||||||
category_label.text = category_text
|
category_label.text = category_text
|
||||||
category_label.visible = not category_text.is_empty()
|
category_label.visible = false
|
||||||
_refresh_labs_button()
|
_refresh_labs_button()
|
||||||
|
|
||||||
presented_choices = question.get("presented_choices", question.get("choices", [])).duplicate(true)
|
presented_choices = question.get("presented_choices", question.get("choices", [])).duplicate(true)
|
||||||
@@ -1716,6 +1717,7 @@ func _show_explanation() -> void:
|
|||||||
explanation_plain_text = str(question.get("explanation", ""))
|
explanation_plain_text = str(question.get("explanation", ""))
|
||||||
_render_explanation()
|
_render_explanation()
|
||||||
explanation_label.visible = true
|
explanation_label.visible = true
|
||||||
|
category_label.visible = not category_label.text.strip_edges().is_empty()
|
||||||
_update_question_elo_label(true)
|
_update_question_elo_label(true)
|
||||||
_refresh_nav_palette()
|
_refresh_nav_palette()
|
||||||
_update_content_vertical_alignment()
|
_update_content_vertical_alignment()
|
||||||
@@ -1740,6 +1742,8 @@ func _clear_answer_review() -> void:
|
|||||||
explanation_label.visible = false
|
explanation_label.visible = false
|
||||||
if correct_review_panel != null:
|
if correct_review_panel != null:
|
||||||
correct_review_panel.visible = false
|
correct_review_panel.visible = false
|
||||||
|
if category_label != null:
|
||||||
|
category_label.visible = false
|
||||||
_clear_container_children(teaching_cards)
|
_clear_container_children(teaching_cards)
|
||||||
_clear_container_children(review_followups_content)
|
_clear_container_children(review_followups_content)
|
||||||
review_followup_states.clear()
|
review_followup_states.clear()
|
||||||
@@ -1751,13 +1755,7 @@ func _clear_answer_review() -> void:
|
|||||||
func _update_content_vertical_alignment() -> void:
|
func _update_content_vertical_alignment() -> void:
|
||||||
if question_content == null:
|
if question_content == null:
|
||||||
return
|
return
|
||||||
# Before an answer is submitted the stem+choices block is usually shorter than the
|
question_content.alignment = BoxContainer.ALIGNMENT_BEGIN
|
||||||
# available panel height; center it so it doesn't sit pinned to the top with a slab
|
|
||||||
# of empty space below. Once the answer review content appears, go back to top
|
|
||||||
# alignment so the growing explanation/follow-up sections read top-down and scroll
|
|
||||||
# naturally instead of being centered mid-panel.
|
|
||||||
var answered := correct_review_panel != null and correct_review_panel.visible
|
|
||||||
question_content.alignment = BoxContainer.ALIGNMENT_BEGIN if answered else BoxContainer.ALIGNMENT_CENTER
|
|
||||||
|
|
||||||
|
|
||||||
func _clear_container_children(container: Control) -> void:
|
func _clear_container_children(container: Control) -> void:
|
||||||
@@ -2279,7 +2277,7 @@ func _refresh_toolbar_state() -> void:
|
|||||||
if notes_button != null:
|
if notes_button != null:
|
||||||
notes_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
notes_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
||||||
if flashcard_button != null:
|
if flashcard_button != null:
|
||||||
flashcard_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
flashcard_button.visible = Brand.is_uat_environment() and BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
||||||
flashcard_button.disabled = current_answer.is_empty()
|
flashcard_button.disabled = current_answer.is_empty()
|
||||||
if bookmark_button != null:
|
if bookmark_button != null:
|
||||||
bookmark_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
bookmark_button.visible = BlockSessionService.session_kind not in ["simulation", "dynamic"]
|
||||||
|
|||||||
Reference in New Issue
Block a user