mirror of
https://github.com/mvvasilev/last_light.git
synced 2025-04-19 12:49:52 +03:00
63 lines
1.2 KiB
Go
63 lines
1.2 KiB
Go
|
package ui
|
||
|
|
||
|
import (
|
||
|
"mvvasilev/last_light/render"
|
||
|
"mvvasilev/last_light/util"
|
||
|
|
||
|
"github.com/gdamore/tcell/v2"
|
||
|
"github.com/gdamore/tcell/v2/views"
|
||
|
"github.com/google/uuid"
|
||
|
)
|
||
|
|
||
|
type UIBorderedButton struct {
|
||
|
id uuid.UUID
|
||
|
|
||
|
text render.Text
|
||
|
border render.Rectangle
|
||
|
|
||
|
isSelected bool
|
||
|
|
||
|
unselectedStyle tcell.Style
|
||
|
selectedStyle tcell.Style
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) IsSelected() bool {
|
||
|
return b.isSelected
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Select() {
|
||
|
b.isSelected = true
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Deselect() {
|
||
|
b.isSelected = false
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) SetSelected(selected bool) {
|
||
|
b.isSelected = selected
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) UniqueId() uuid.UUID {
|
||
|
return b.id
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) MoveTo(x uint16, y uint16) {
|
||
|
panic("not implemented") // TODO: Implement
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Position() util.Position {
|
||
|
panic("not implemented") // TODO: Implement
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Size() util.Size {
|
||
|
panic("not implemented") // TODO: Implement
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Draw(v views.View) {
|
||
|
panic("not implemented") // TODO: Implement
|
||
|
}
|
||
|
|
||
|
func (b *UIBorderedButton) Input(e *tcell.EventKey) {
|
||
|
panic("not implemented") // TODO: Implement
|
||
|
}
|