From 9c7b139e5ac7c0fbec70a827aab6d0d2b9a030b7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 6 Feb 2025 04:47:50 -0600 Subject: full screen BG widget is created. good enough to ship it --- find.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'find.go') diff --git a/find.go b/find.go index b07f711..274e544 100644 --- a/find.go +++ b/find.go @@ -91,6 +91,23 @@ func (tk *guiWidget) findWindows() []*guiWidget { return found } +// find the BG widget. +// This widget is always in the background and covers the whole screen. +// gocui seems to not return mouse events unless there is something there +func (tk *guiWidget) findBG() *guiWidget { + if tk.node.WidgetType == widget.Stdout { + tk.isBG = true + return tk + } + + for _, child := range tk.children { + if found := child.findBG(); found != nil { + return found + } + } + return nil +} + // returns the "highest priority widget under the mouse func findUnderMouse() *guiWidget { w, h := me.baseGui.MousePosition() -- cgit v1.2.3