Button now removes its label if it is empty
This commit is contained in:
parent
b4ab60df77
commit
f99f60d642
33
button.go
33
button.go
@ -7,13 +7,17 @@ import "git.tebibyte.media/tomo/tomo/event"
|
|||||||
import "git.tebibyte.media/tomo/objects/layouts"
|
import "git.tebibyte.media/tomo/objects/layouts"
|
||||||
|
|
||||||
var buttonLayout = layouts.NewGrid([]bool { true }, []bool { true })
|
var buttonLayout = layouts.NewGrid([]bool { true }, []bool { true })
|
||||||
var iconButtonLayout = layouts.NewGrid([]bool { false, true }, []bool { true })
|
var iconButtonLayout = layouts.NewGrid([]bool { false }, []bool { true })
|
||||||
|
var bothButtonLayout = layouts.NewGrid([]bool { false, true }, []bool { true })
|
||||||
|
|
||||||
// Button is a clickable button.
|
// Button is a clickable button.
|
||||||
type Button struct {
|
type Button struct {
|
||||||
tomo.ContainerBox
|
tomo.ContainerBox
|
||||||
|
|
||||||
label *Label
|
label *Label
|
||||||
icon *Icon
|
icon *Icon
|
||||||
|
labelActive bool
|
||||||
|
|
||||||
on struct {
|
on struct {
|
||||||
click event.FuncBroadcaster
|
click event.FuncBroadcaster
|
||||||
}
|
}
|
||||||