Button.SetIcon now takes in theme.Icon
This commit is contained in:
parent
39541e1b78
commit
49f010a8d6
10
button.go
10
button.go
@ -46,10 +46,14 @@ func (this *Button) SetText (text string) {
|
|||||||
this.label.SetText(text)
|
this.label.SetText(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetIcon sets an icon for this button.
|
// SetIcon sets an icon for this button. Setting the icon to IconUnknown will
|
||||||
// TODO: use tomo.Icon instead, use small size icons
|
// remove it.
|
||||||
func (this *Button) SetIcon (icon *Icon) {
|
func (this *Button) SetIcon (id theme.Icon) {
|
||||||
if this.icon != nil { this.Delete(this.icon) }
|
if this.icon != nil { this.Delete(this.icon) }
|
||||||
|
|
||||||
|
var icon *Icon; if id != theme.IconUnknown {
|
||||||
|
icon = NewIcon(id, theme.IconSizeSmall)
|
||||||
|
}
|
||||||
this.icon = icon
|
this.icon = icon
|
||||||
|
|
||||||
if this.icon == nil {
|
if this.icon == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user