refactor(@projects/@magic-civilization): 🎨 happiness_breakdown_panel labels → theme_type_variation (p2-87)
Migrate 5 font_color overrides to theme_type_variation (LabelTitle/Secondary/Positive/Negative/Muted). Inline StyleBoxFlat (panel bg) left for the StyleBox sub-sweep. Value-preserving (variations carry the same token colours) + gdlint clean. No direct render harness (this panel opens on in-game interaction, not coverable by a proof scene or the magic-civ open_screen surface); the variation pattern is render-proven by the statistics + hotkey_sheet iterations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3b09bb35a1
commit
3f82ff6fb5
1 changed files with 5 additions and 5 deletions
|
|
@ -31,7 +31,7 @@ func _ready() -> void:
|
|||
var title: Label = Label.new()
|
||||
title.text = ThemeVocabulary.lookup("happiness_breakdown_title")
|
||||
title.add_theme_font_size_override("font_size", 14)
|
||||
title.add_theme_color_override("font_color", ThemeAssets.color("text.title"))
|
||||
title.theme_type_variation = "LabelTitle"
|
||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
_vbox.add_child(title)
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ func _add_line(label_text: String, value: int) -> void:
|
|||
lbl.text = label_text
|
||||
lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
lbl.add_theme_font_size_override("font_size", 13)
|
||||
lbl.add_theme_color_override("font_color", ThemeAssets.color("text.secondary"))
|
||||
lbl.theme_type_variation = "LabelSecondary"
|
||||
row.add_child(lbl)
|
||||
|
||||
var val_lbl: Label = Label.new()
|
||||
|
|
@ -76,11 +76,11 @@ func _add_line(label_text: String, value: int) -> void:
|
|||
val_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
val_lbl.add_theme_font_size_override("font_size", 13)
|
||||
if value > 0:
|
||||
val_lbl.add_theme_color_override("font_color", ThemeAssets.color("semantic.positive"))
|
||||
val_lbl.theme_type_variation = "LabelPositive"
|
||||
elif value < 0:
|
||||
val_lbl.add_theme_color_override("font_color", ThemeAssets.color("semantic.negative"))
|
||||
val_lbl.theme_type_variation = "LabelNegative"
|
||||
else:
|
||||
val_lbl.add_theme_color_override("font_color", ThemeAssets.color("text.muted"))
|
||||
val_lbl.theme_type_variation = "LabelMuted"
|
||||
row.add_child(val_lbl)
|
||||
|
||||
_vbox.add_child(row)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue