Refine physical exam chart layout

This commit is contained in:
hz
2026-08-13 22:21:02 -05:00
parent 6312b45a92
commit 7da07cb2a4
2 changed files with 16 additions and 4 deletions
+13 -4
View File
@@ -64,6 +64,7 @@ var available_exams: Array = []
var attempt_chart: Array = []
var medical_history_section_title: Label
var medical_history_exam_text: RichTextLabel
var medical_history_exam_scroll: ScrollContainer
var medical_history_tab_button: Button
var physical_exam_tab_button: Button
var experience_mode := "management"
@@ -411,18 +412,25 @@ func _build_medical_history_tabs() -> void:
physical_exam_tab_button.text = "Physical Exam"
physical_exam_tab_button.pressed.connect(_show_chart_tab.bind(true))
tabs.add_child(physical_exam_tab_button)
medical_history_exam_scroll = ScrollContainer.new()
medical_history_exam_scroll.custom_minimum_size = Vector2(0.0, 120.0)
medical_history_exam_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
medical_history_exam_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
content.add_child(medical_history_exam_scroll)
medical_history_exam_text = RichTextLabel.new()
medical_history_exam_text.bbcode_enabled = true
medical_history_exam_text.fit_content = true
medical_history_exam_text.custom_minimum_size = Vector2(0.0, 120.0)
medical_history_exam_text.custom_minimum_size = Vector2(560.0, 120.0)
medical_history_exam_text.size_flags_horizontal = Control.SIZE_EXPAND_FILL
medical_history_exam_text.add_theme_font_size_override("normal_font_size", 18)
content.add_child(medical_history_exam_text)
medical_history_exam_scroll.add_child(medical_history_exam_text)
_show_chart_tab(false)
func _show_chart_tab(show_exams: bool) -> void:
medical_history_section_title.visible = not show_exams
medical_history_text.visible = not show_exams
medical_history_exam_text.visible = show_exams
medical_history_exam_scroll.visible = show_exams
medical_history_tab_button.disabled = not show_exams
physical_exam_tab_button.disabled = show_exams
_resize_computer_windows()
@@ -568,7 +576,8 @@ func _resize_computer_windows() -> void:
minf(vitals_content_height, maxf(300.0, size.y - 48.0)))
_set_centered_window_rect(vitals_window, vitals_size, Vector2(-55.0, -25.0))
var exam_count := medical_history_exam_text.text.count("[b]") if medical_history_exam_text != null else 0
var history_height := 340.0 if not medical_history_exam_text.visible else clampf(250.0 + exam_count * 90.0, 340.0, 650.0)
var showing_exams := medical_history_exam_scroll != null and medical_history_exam_scroll.visible
var history_height := 340.0 if not showing_exams else clampf(250.0 + exam_count * 105.0, 340.0, 650.0)
var history_size := Vector2(
minf(680.0, maxf(320.0, size.x - 48.0)),
minf(history_height, maxf(300.0, size.y - 48.0)))