style(notifications): 🎨 Apply theme color styling to capital blackout overlay and comms toast notifications
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
65046a032a
commit
5407989139
2 changed files with 19 additions and 12 deletions
|
|
@ -24,7 +24,9 @@ func _ready() -> void:
|
|||
func _build_ui() -> void:
|
||||
_dim = ColorRect.new()
|
||||
_dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
_dim.color = Color(0.04, 0.0, 0.02, 0.88)
|
||||
var dim_color: Color = ThemeAssets.color("background.deepest")
|
||||
dim_color.a = 0.88
|
||||
_dim.color = dim_color
|
||||
_dim.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
add_child(_dim)
|
||||
|
||||
|
|
@ -33,7 +35,9 @@ func _build_ui() -> void:
|
|||
_glitch_band.anchor_right = 1.0
|
||||
_glitch_band.anchor_top = 0.42
|
||||
_glitch_band.anchor_bottom = 0.58
|
||||
_glitch_band.color = Color(0.55, 0.05, 0.05, 0.35)
|
||||
var glitch_color: Color = ThemeAssets.color("semantic.negative")
|
||||
glitch_color.a = 0.35
|
||||
_glitch_band.color = glitch_color
|
||||
add_child(_glitch_band)
|
||||
|
||||
var center: CenterContainer = CenterContainer.new()
|
||||
|
|
@ -47,14 +51,14 @@ func _build_ui() -> void:
|
|||
_title_label = Label.new()
|
||||
_title_label.text = TITLE_DEFAULT
|
||||
_title_label.add_theme_font_size_override("font_size", 42)
|
||||
_title_label.add_theme_color_override("font_color", Color(1.0, 0.45, 0.45, 1.0))
|
||||
_title_label.add_theme_color_override("font_color", ThemeAssets.color("semantic.negative"))
|
||||
_title_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
vbox.add_child(_title_label)
|
||||
|
||||
_subtitle_label = Label.new()
|
||||
_subtitle_label.text = SUBTITLE_DEFAULT
|
||||
_subtitle_label.add_theme_font_size_override("font_size", 22)
|
||||
_subtitle_label.add_theme_color_override("font_color", Color(0.9, 0.85, 0.65, 0.95))
|
||||
_subtitle_label.add_theme_color_override("font_color", ThemeAssets.color("text.title"))
|
||||
_subtitle_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
vbox.add_child(_subtitle_label)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ func _ready() -> void:
|
|||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
|
||||
var style: StyleBoxFlat = StyleBoxFlat.new()
|
||||
style.bg_color = Color(0.06, 0.06, 0.10, 0.92)
|
||||
style.border_color = Color(0.85, 0.78, 0.40, 0.95)
|
||||
style.bg_color = ThemeAssets.color("background.panel")
|
||||
style.border_color = ThemeAssets.color("border.panel")
|
||||
style.set_border_width_all(2)
|
||||
style.set_corner_radius_all(6)
|
||||
style.content_margin_left = 12
|
||||
|
|
@ -39,7 +39,7 @@ func _ready() -> void:
|
|||
_icon_rect = ColorRect.new()
|
||||
_icon_rect.custom_minimum_size = Vector2(8, 0)
|
||||
_icon_rect.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
_icon_rect.color = Color(0.85, 0.78, 0.40, 1.0)
|
||||
_icon_rect.color = ThemeAssets.color("accent.gold")
|
||||
row.add_child(_icon_rect)
|
||||
|
||||
var col: VBoxContainer = VBoxContainer.new()
|
||||
|
|
@ -49,12 +49,12 @@ func _ready() -> void:
|
|||
|
||||
_title = Label.new()
|
||||
_title.add_theme_font_size_override("font_size", 16)
|
||||
_title.add_theme_color_override("font_color", Color(1.0, 0.94, 0.75, 1.0))
|
||||
_title.add_theme_color_override("font_color", ThemeAssets.color("text.title"))
|
||||
col.add_child(_title)
|
||||
|
||||
_body = Label.new()
|
||||
_body.add_theme_font_size_override("font_size", 13)
|
||||
_body.add_theme_color_override("font_color", Color(0.88, 0.88, 0.84, 1.0))
|
||||
_body.add_theme_color_override("font_color", ThemeAssets.color("text.primary"))
|
||||
_body.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
col.add_child(_body)
|
||||
|
||||
|
|
@ -66,16 +66,19 @@ func _ready() -> void:
|
|||
|
||||
|
||||
## Parameterise the toast at spawn time. Call after add_child / before showing.
|
||||
func configure(title: String, body: String, accent: Color = Color(0.85, 0.78, 0.40, 1.0)) -> void:
|
||||
## A null accent falls back to the gold design token (param defaults can't call
|
||||
## the ThemeAssets autoload, so the sentinel is resolved here in the body).
|
||||
func configure(title: String, body: String, accent: Variant = null) -> void:
|
||||
_title.text = title
|
||||
_body.text = body
|
||||
if _title.text.is_empty():
|
||||
_title.visible = false
|
||||
_icon_rect.color = accent
|
||||
var accent_color: Color = accent if accent is Color else ThemeAssets.color("accent.gold")
|
||||
_icon_rect.color = accent_color
|
||||
|
||||
var style: StyleBoxFlat = get_theme_stylebox("panel") as StyleBoxFlat
|
||||
if style != null:
|
||||
style.border_color = accent
|
||||
style.border_color = accent_color
|
||||
|
||||
modulate.a = 0.0
|
||||
var tween: Tween = create_tween()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue