Add ability to change an icon's icon

This commit is contained in:
Sasha Koshka 2023-03-21 12:26:06 -04:00
parent faf5ebb283
commit 60aac053fb
2 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,16 @@ func NewIcon (id theme.Icon, size theme.IconSize) (element *Icon) {
return
}
func (element *Icon) SetIcon (id theme.Icon, size theme.IconSize) {
element.id = id
element.size = size
element.updateMinimumSize()
if element.core.HasImage() {
element.draw()
element.core.DamageAll()
}
}
// SetTheme sets the element's theme.
func (element *Icon) SetTheme (new theme.Theme) {
if new == element.theme.Theme { return }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB