A lot of layout work
This commit is contained in:
16
widget.go
16
widget.go
@@ -33,7 +33,6 @@ type Widget interface {
|
||||
HandleKey(*tcell.EventKey) bool
|
||||
HandleTime(*tcell.EventTime)
|
||||
Draw(tcell.Screen)
|
||||
DrawOffset(Coord, tcell.Screen)
|
||||
Active() bool
|
||||
SetActive(bool)
|
||||
Visible() bool
|
||||
@@ -73,21 +72,6 @@ func WidgetRight(w Widget) int {
|
||||
return w.GetX() + w.GetW()
|
||||
}
|
||||
|
||||
type Coord struct {
|
||||
X, Y int
|
||||
}
|
||||
|
||||
func (p *Coord) Add(o Coord) Coord {
|
||||
return Coord{
|
||||
X: p.X + o.X,
|
||||
Y: p.Y + o.Y,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Coord) ResizeEvent() *tcell.EventResize {
|
||||
return tcell.NewEventResize(p.X, p.Y)
|
||||
}
|
||||
|
||||
// To validate that a struct satisfies this interface, you can do:
|
||||
// var _ Widget - (*<struct>)(nil)
|
||||
// where <struct> is the actual struct that you're validating.
|
||||
|
||||
Reference in New Issue
Block a user