Files
settled-reach/client/ui/implant/implant_data_row.gd
T
jpmschweitzerandClaude Opus 4.6 6ad1c8255f fix(ui): implant panel width constraint and text wrapping
Panel now clips content and constrains children to its width.
Components set autowrap and SIZE_FLAGS_FILL so text wraps within
the panel instead of overflowing. Bold markdown markers stripped
in ImplantTextBlock constructor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 10:51:25 +02:00

31 lines
963 B
GDScript

@tool
class_name ImplantDataRow
extends Label
## Single-line data display — text with optional color override.
var _color_override: Color = Color.TRANSPARENT # transparent = use theme default
func _init(text: String = "", color: Color = Color.TRANSPARENT) -> void:
self.text = text
_color_override = color
mouse_filter = Control.MOUSE_FILTER_IGNORE
autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
size_flags_horizontal = Control.SIZE_FLAGS_FILL
func set_content(text_value: String, color: Color = Color.TRANSPARENT) -> void:
text = text_value
_color_override = color
if _color_override.a > 0.0:
add_theme_color_override("font_color", _color_override)
func apply_implant_theme(t: ImplantTheme) -> void:
add_theme_font_size_override("font_size", t.font_body)
if _color_override.a > 0.0:
add_theme_color_override("font_color", _color_override)
else:
add_theme_color_override("font_color", t.text_dim)
custom_minimum_size.y = t.line_height