1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package tui
import "github.com/grindlemire/go-tui/internal/debug"
type overlayEntry struct {
element *Element
backdrop string
trapFocus bool
needsFocusInit bool
}
func (a *App) registerOverlay(el *Element, backdrop string, trapFocus bool, needsFocusInit bool) {
if !a.inAlternateScreen && a.inlineHeight > 0 {
debug.Log("registerOverlay: ignored in inline mode (inlineHeight=%d); use EnterAlternateScreen() before opening a modal", a.inlineHeight)
return
}
a.overlays = append(a.overlays, &overlayEntry{
element: el,
backdrop: backdrop,
trapFocus: trapFocus,
needsFocusInit: needsFocusInit,
})
}
func (a *App) clearOverlays() {
a.overlays = a.overlays[:0]
}
|