Button now removes its label if it is empty

This commit is contained in:
Sasha Koshka 2024-05-07 20:15:49 -04:00
parent b4ab60df77
commit f99f60d642

View File

@ -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
} }