fix(ui): sharpen round-button icons
Import icon SVGs at 120px intrinsic size, expand them in round buttons with content margins preserving the original visual size, and assert icon resolution in QA.
This commit is contained in:
1 parent
3587c7bd64
commit
7abd1226cb
17 files changed
+73
-31
No files matched your search
+7
-1
@@ -86,7 +86,7 @@ static func round_button(icon_path: String, size: int = 48) -> Button:
|
||||
var b := Button.new()
|
||||
b.custom_minimum_size = Vector2(size, size)
|
||||
b.icon = load(icon_path)
|
||||
b.expand_icon = false
|
||||
b.expand_icon = true
|
||||
b.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
b.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
b.add_theme_stylebox_override("normal", _round_style(Palette.PAPER))
|
||||
@@ -186,6 +186,12 @@ static func _round_style(color: Color) -> StyleBoxFlat:
|
||||
s.corner_radius_top_right = 26
|
||||
s.corner_radius_bottom_left = 26
|
||||
s.corner_radius_bottom_right = 26
|
||||
# Keep high-resolution icons near their original visual size inside the
|
||||
# round button instead of letting expand_icon fill the whole control.
|
||||
s.content_margin_left = 10
|
||||
s.content_margin_right = 10
|
||||
s.content_margin_top = 10
|
||||
s.content_margin_bottom = 10
|
||||
s.shadow_color = Color(0.29, 0.20, 0.14, 0.12)
|
||||
s.shadow_size = 4
|
||||
s.shadow_offset = Vector2(0, 2)
|
||||
|
||||
Reference in new issue
Block a user