From 73a5fab0bc8029e85c2c08adce71c5c86ade6704 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sun, 11 Aug 2024 12:20:23 -0400 Subject: [PATCH] Icon sets its minimum size properly --- icon.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/icon.go b/icon.go index 19c24f1..90308fa 100644 --- a/icon.go +++ b/icon.go @@ -27,6 +27,9 @@ func NewIcon (icon tomo.Icon, size tomo.IconSize) *Icon { // SetIcon sets the icon. func (this *Icon) SetIcon (icon tomo.Icon, size tomo.IconSize) { + iconTexture := icon.Texture(size) + bounds := iconTexture.Bounds() this.SetAttr(tomo.AIcon(icon, size)) + this.SetAttr(tomo.AMinimumSize(bounds.Dx(), bounds.Dy())) this.SetTag(iconSizeString(size), true) }