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) }