Really figuring some things out
This commit is contained in:
@@ -21,7 +21,10 @@ THE SOFTWARE.
|
||||
*/
|
||||
package widgets
|
||||
|
||||
import "github.com/gdamore/tcell"
|
||||
import (
|
||||
wh "git.bullercodeworks.com/brian/tcell-widgets/helpers"
|
||||
"github.com/gdamore/tcell"
|
||||
)
|
||||
|
||||
type RelativeLayout struct {
|
||||
id string
|
||||
@@ -74,10 +77,17 @@ func (w *RelativeLayout) Init(id string, style tcell.Style) {
|
||||
w.visible = true
|
||||
w.tabbable = true
|
||||
}
|
||||
func (w *RelativeLayout) Id() string { return w.id }
|
||||
func (w *RelativeLayout) HandleResize(ev *tcell.EventResize) {}
|
||||
func (w *RelativeLayout) HandleKey(ev *tcell.EventKey) bool { return false }
|
||||
func (w *RelativeLayout) HandleTime(ev *tcell.EventTime) {}
|
||||
func (w *RelativeLayout) Id() string { return w.id }
|
||||
func (w *RelativeLayout) HandleResize(ev *tcell.EventResize) {
|
||||
w.w, w.h = ev.Size()
|
||||
|
||||
w.w = wh.Min(w.w, w.WantW())
|
||||
w.h = wh.Min(w.h, w.WantH())
|
||||
|
||||
// TODO: Trickle-down HandleResize
|
||||
}
|
||||
func (w *RelativeLayout) HandleKey(ev *tcell.EventKey) bool { return false }
|
||||
func (w *RelativeLayout) HandleTime(ev *tcell.EventTime) {}
|
||||
func (w *RelativeLayout) Draw(screen tcell.Screen) {
|
||||
if !w.visible {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user