Icon sets its minimum size properly
This commit is contained in:
parent
61addc051b
commit
73a5fab0bc
3
icon.go
3
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user