Really figuring some things out

This commit is contained in:
2025-08-07 11:18:03 -05:00
parent 7c96fbb187
commit b476c74683
23 changed files with 737 additions and 249 deletions

View File

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