Fix Searcher Layout
This commit is contained in:
@@ -84,11 +84,10 @@ 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.w = wh.Min(w.w, w.WantW())
|
||||
// w.h = wh.Min(w.h, w.WantH())
|
||||
// TODO: Verify this is fine:
|
||||
w.search.HandleResize(ev)
|
||||
// Remove 2 from each for borders
|
||||
aW, aH := w.w-2, w.h-2
|
||||
w.search.SetPos(Coord{X: 1, Y: 1})
|
||||
w.search.HandleResize(Coord{X: aW, Y: aH}.ResizeEvent())
|
||||
}
|
||||
|
||||
func (w *Searcher) HandleKey(ev *tcell.EventKey) bool {
|
||||
@@ -173,8 +172,6 @@ func (w *Searcher) Draw(screen tcell.Screen) {
|
||||
if !w.visible {
|
||||
return
|
||||
}
|
||||
w.search.SetPos(Coord{X: w.x + 1, Y: w.y + 1})
|
||||
w.search.SetSize(Coord{X: w.w - 2, Y: 1})
|
||||
dStyle := w.style
|
||||
if !w.active {
|
||||
dStyle = dStyle.Dim(true)
|
||||
|
||||
Reference in New Issue
Block a user