Working some things out
This commit is contained in:
@@ -84,6 +84,7 @@ func (w *Searcher) Init(id string, style tcell.Style) {
|
||||
func (w *Searcher) Id() string { return w.id }
|
||||
func (w *Searcher) HandleResize(ev *tcell.EventResize) {
|
||||
w.w, w.h = ev.Size()
|
||||
w.Log("Searcher<%s>.HandleResize: %d,%d", w.Id(), w.w, w.h)
|
||||
// Remove 2 from each for borders
|
||||
aW, aH := w.w-2, w.h-2
|
||||
w.search.SetPos(Coord{X: 1, Y: 1})
|
||||
@@ -172,10 +173,7 @@ func (w *Searcher) Draw(screen tcell.Screen) {
|
||||
if !w.visible {
|
||||
return
|
||||
}
|
||||
dStyle := w.style
|
||||
if !w.active {
|
||||
dStyle = dStyle.Dim(true)
|
||||
}
|
||||
dStyle := w.style.Dim(!w.active)
|
||||
if len(w.title) > 0 {
|
||||
wh.TitledBorderFilled(w.x, w.y, w.x+w.w, w.y+w.h, w.title, wh.BRD_CSIMPLE, dStyle, screen)
|
||||
} else {
|
||||
@@ -235,7 +233,7 @@ func (w *Searcher) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
|
||||
func (w *Searcher) SetW(x int) { w.w = x }
|
||||
func (w *Searcher) SetH(y int) { w.h = y }
|
||||
func (w *Searcher) GetW() int { return w.w }
|
||||
func (w *Searcher) GetH() int { return w.y }
|
||||
func (w *Searcher) GetH() int { return w.h }
|
||||
func (w *Searcher) SetSize(c Coord) { w.w, w.h = c.X, c.Y }
|
||||
func (w *Searcher) Focusable() bool { return true }
|
||||
func (w *Searcher) SetTabbable(b bool) { w.tabbable = b }
|
||||
@@ -310,6 +308,6 @@ func (w *Searcher) ClearSearch() {
|
||||
func (w *Searcher) SetLogger(l func(string, ...any)) { w.logger = l }
|
||||
func (w *Searcher) Log(txt string, args ...any) {
|
||||
if w.logger != nil {
|
||||
w.logger(txt, args)
|
||||
w.logger(txt, args...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user