Icon sets its minimum size properly

This commit is contained in:
Sasha Koshka 2024-08-11 12:20:23 -04:00
parent 61addc051b
commit 73a5fab0bc

View File

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