Buttons can have icons (wip)
This commit is contained in:
parent
59ca14cab6
commit
312ee6270c
39
button.go
39
button.go
@ -4,10 +4,16 @@ import "git.tebibyte.media/tomo/tomo"
|
|||||||
import "git.tebibyte.media/tomo/tomo/theme"
|
import "git.tebibyte.media/tomo/tomo/theme"
|
||||||
import "git.tebibyte.media/tomo/tomo/input"
|
import "git.tebibyte.media/tomo/tomo/input"
|
||||||
import "git.tebibyte.media/tomo/tomo/event"
|
import "git.tebibyte.media/tomo/tomo/event"
|
||||||
|
import "git.tebibyte.media/tomo/objects/layouts"
|
||||||
|
|
||||||
|
var buttonLayout = layouts.NewGrid([]bool { true }, []bool { true })
|
||||||
|
var iconButtonLayout = layouts.NewGrid([]bool { false, true }, []bool { true })
|
||||||
|
|
||||||
// Button is a clickable button.
|
// Button is a clickable button.
|
||||||
type Button struct {
|
type Button struct {
|
||||||
tomo.TextBox
|
tomo.ContainerBox
|
||||||
|
label *Label
|
||||||
|
icon *Icon
|
||||||
on struct {
|
on struct {
|
||||||
click event.FuncBroadcaster
|
click event.FuncBroadcaster
|
||||||
}
|
}
|
||||||