Polish question player header/toolbar and add configurable block size

- Fix the toolbar wrapping onto two rows: its minimum width was tuned
  for an older, narrower button set and never widened back out after
  reverting to bare icon buttons.
- Drop the "Time elapsed"/"Ctrl+Enter" readout next to Submit - it was
  clutter; the underlying timer logic keeps running unseen.
- Move the RanaZe brand mark above the question-count row instead of
  sharing a line with it.
- Progress text drops the word "Question" everywhere ("1 of 10"), and
  core/dynamic sessions now cycle against a configurable block size
  (Settings > Question block size, default 10) instead of counting up
  forever.
This commit is contained in:
hz
2026-07-24 21:57:03 -05:00
parent 62e65fd22c
commit 50f54b1bec
3 changed files with 87 additions and 22 deletions
+15 -22
View File
@@ -221,13 +221,10 @@ func _ready() -> void:
header_stack = VBoxContainer.new()
header_stack.add_theme_constant_override("separation", 8)
card_content.add_child(header_stack)
header_row = HBoxContainer.new()
header_row.add_theme_constant_override("separation", 16)
header_stack.add_child(header_row)
var header_brand := HBoxContainer.new()
header_brand.add_theme_constant_override("separation", 8)
header_row.add_child(header_brand)
header_stack.add_child(header_brand)
var header_brand_mark := TextureRect.new()
header_brand_mark.texture = Brand.ranaze_mark_texture()
header_brand_mark.custom_minimum_size = Vector2(28, 28)
@@ -240,6 +237,10 @@ func _ready() -> void:
header_wordmark_label.add_theme_font_size_override("font_size", 18)
header_brand.add_child(header_wordmark_label)
header_row = HBoxContainer.new()
header_row.add_theme_constant_override("separation", 16)
header_stack.add_child(header_row)
var progress_group := VBoxContainer.new()
progress_group.add_theme_constant_override("separation", 2)
progress_group.size_flags_vertical = Control.SIZE_SHRINK_CENTER
@@ -660,15 +661,13 @@ func _ready() -> void:
bottom_progress_bar.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
bottom_progress_group.add_child(bottom_progress_bar)
var time_group := VBoxContainer.new()
time_group.add_theme_constant_override("separation", 0)
actions.add_child(time_group)
# The timer readout still runs (BlockSessionService pacing/scoring depends on
# it, and _update_timer_bar keeps its text current), it's just no longer
# parented into the bottom bar - the caption + digits and the "Ctrl+Enter"
# hint were clutter next to the Submit button.
timer_caption_label = Label.new()
timer_caption_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
_set_scaled_label(timer_caption_label, 12, Brand.SLATE)
time_group.add_child(timer_caption_label)
time_group.add_child(timer_label)
next_button = Button.new()
next_button.text = "Submit Block" if BlockSessionService.session_kind == "simulation" and BlockSessionService.current_index + 1 == BlockSessionService.active_questions.size() else "Next" if BlockSessionService.session_kind == "simulation" else "Submit"
@@ -678,12 +677,6 @@ func _ready() -> void:
next_button.pressed.connect(_submit_or_next)
actions.add_child(next_button)
var shortcut_hint_label := Label.new()
shortcut_hint_label.name = "SubmitShortcutHint"
shortcut_hint_label.text = "⌘ Enter" if OS.get_name() == "macOS" else "Ctrl+Enter"
_set_scaled_label(shortcut_hint_label, 11, Brand.SLATE)
actions.add_child(shortcut_hint_label)
timer_footer = HBoxContainer.new()
timer_footer.add_theme_constant_override("separation", 12)
card_content.add_child(timer_footer)
@@ -793,7 +786,9 @@ func _refresh_responsive_layout() -> void:
header_toolbar_host.reparent(target_parent)
header_toolbar_host.size_flags_horizontal = Control.SIZE_EXPAND_FILL if compact else Control.SIZE_SHRINK_END
question_toolbar.size_flags_horizontal = Control.SIZE_EXPAND_FILL
header_toolbar_host.custom_minimum_size.x = 0.0 if compact else 520.0
# 11 bare 44px icon buttons + the wider 92px Feedback button, with 8px gaps
# between all 12 - anything less than this wraps onto a second row.
header_toolbar_host.custom_minimum_size.x = 0.0 if compact else 680.0
if size.x < 560.0:
nav_palette.columns = 5
else:
@@ -1074,9 +1069,6 @@ func _apply_question_theme() -> void:
skip_button.add_theme_color_override("font_color", skip_link_color)
skip_button.add_theme_color_override("font_hover_color", skip_link_color)
skip_button.add_theme_color_override("font_disabled_color", Brand.muted_color(dark))
var shortcut_hint := find_child("SubmitShortcutHint", true, false) as Label
if shortcut_hint != null:
shortcut_hint.add_theme_color_override("font_color", Brand.muted_color(dark))
if next_button != null:
next_button.add_theme_stylebox_override("normal", _primary_action_box(dark, "normal"))
next_button.add_theme_stylebox_override("hover", _primary_action_box(dark, "hover"))
@@ -2078,8 +2070,9 @@ func _is_session_timer_visible() -> bool:
func _question_progress_text() -> String:
if BlockSessionService.session_kind == "core":
return "Question %d" % (BlockSessionService.core_answer_count + 1)
return "Question %d of %d" % [
var block_size := BlockSessionService.core_block_size
return "%d of %d" % [(BlockSessionService.core_answer_count % block_size) + 1, block_size]
return "%d of %d" % [
mini(BlockSessionService.current_index + 1, BlockSessionService.active_questions.size()),
BlockSessionService.active_questions.size()
]