Add ability to change an icon's icon
This commit is contained in:
parent
faf5ebb283
commit
60aac053fb
@ -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 |
Reference in New Issue
Block a user