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
+41
View File
@@ -4,12 +4,14 @@ const Brand := preload("res://scripts/ui/medmind_style.gd")
const QUESTION_TEXT_SCALE_MIN := 0.85
const QUESTION_TEXT_SCALE_MAX := 1.35
const QUESTION_TEXT_SCALE_STEP := 0.1
const CORE_BLOCK_SIZE_STEP := 5
var main: Control
var theme_toggle: CheckButton
var sound_toggle: CheckButton
var question_scale_value_label: Label
var ccs_scale_value_label: Label
var core_block_size_value_label: Label
func _ready() -> void:
@@ -59,6 +61,7 @@ func _ready() -> void:
content.add_child(_build_text_scale_row("Question bank text size", "question"))
content.add_child(_build_text_scale_row("CCS case text size", "ccs"))
content.add_child(_build_core_block_size_row())
var legal_panel := PanelContainer.new()
legal_panel.custom_minimum_size = Vector2(520, 0)
@@ -131,6 +134,42 @@ func _build_text_scale_row(label_text: String, kind: String) -> HBoxContainer:
return row
func _build_core_block_size_row() -> HBoxContainer:
var row := HBoxContainer.new()
row.custom_minimum_size = Vector2(0, 52)
row.add_theme_constant_override("separation", 12)
var label := Label.new()
label.text = "Question block size"
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
row.add_child(label)
var smaller := Button.new()
smaller.text = "-"
smaller.tooltip_text = "Fewer questions per block"
smaller.custom_minimum_size = Vector2(44, 44)
smaller.pressed.connect(_adjust_core_block_size.bind(-CORE_BLOCK_SIZE_STEP))
row.add_child(smaller)
core_block_size_value_label = Label.new()
core_block_size_value_label.custom_minimum_size = Vector2(56, 0)
core_block_size_value_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
row.add_child(core_block_size_value_label)
var larger := Button.new()
larger.text = "+"
larger.tooltip_text = "More questions per block"
larger.custom_minimum_size = Vector2(44, 44)
larger.pressed.connect(_adjust_core_block_size.bind(CORE_BLOCK_SIZE_STEP))
row.add_child(larger)
return row
func _adjust_core_block_size(delta: int) -> void:
BlockSessionService.set_core_block_size(BlockSessionService.core_block_size + delta)
_refresh_text_scale_labels()
func _adjust_question_text_scale(delta: float) -> void:
var current: float = AccountProfileService.preferences.get("questionTextScale", 1.0)
var next_scale: float = clamp(current + delta, QUESTION_TEXT_SCALE_MIN, QUESTION_TEXT_SCALE_MAX)
@@ -149,6 +188,8 @@ func _refresh_text_scale_labels() -> void:
question_scale_value_label.text = "%d%%" % round(question_scale * 100)
if ccs_scale_value_label != null:
ccs_scale_value_label.text = "%d%%" % round(CCSService.text_scale * 100)
if core_block_size_value_label != null:
core_block_size_value_label.text = str(BlockSessionService.core_block_size)
func _on_theme_toggled(enabled: bool) -> void: