diff --git a/go.mod b/go.mod index 52fa885..be1cc63 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/andybalholm/brotli v1.2.5 github.com/ayn2op/arikawa/v3 v3.0.0-20260904042054-7df757872273 github.com/ayn2op/ningen/v3 v3.0.1-0.20260904045623-5978c9be899f - github.com/ayn2op/tview v0.0.0-20260928000403-b1f6164a02e5 + github.com/ayn2op/tview v0.0.0-20260928003911-758a51d24cad github.com/bogdanfinn/fhttp v0.6.9 github.com/bogdanfinn/tls-client v1.16.0 github.com/gdamore/tcell/v3 v3.5.0 diff --git a/go.sum b/go.sum index 0cc9abe..73e68e3 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/ayn2op/arikawa/v3 v3.0.0-20260904042054-7df757872273 h1:cJ1donaon2Cjh github.com/ayn2op/arikawa/v3 v3.0.0-20260904042054-7df757872273/go.mod h1:bzMgZqBnJr1pu7EHq2d9906sAtHA+iklIxxvnS5kfDo= github.com/ayn2op/ningen/v3 v3.0.1-0.20260904045623-5978c9be899f h1:RrbCgoBOmYsLJAaf4lES+eoJYOG7zQMykACIFZgEvdU= github.com/ayn2op/ningen/v3 v3.0.1-0.20260904045623-5978c9be899f/go.mod h1:j8CBNjCkOpsgQm6X2xYJ0kXu5Y/PiQ+6QxxmExCq1Fs= -github.com/ayn2op/tview v0.0.0-20260928000403-b1f6164a02e5 h1:90J4ipdQLF+nvfPPMoHCWAPlvNgXqPmRCejn7PatvHE= -github.com/ayn2op/tview v0.0.0-20260928000403-b1f6164a02e5/go.mod h1:oRPTSZgaEJPhv3dmmNvo6grBq/BemrLG3wFQLMTZJkY= +github.com/ayn2op/tview v0.0.0-20260928003911-758a51d24cad h1:NzrmJFrWVtRVY8u+Q9HUv0ow9dvlu4s+YdrqEnh4yGM= +github.com/ayn2op/tview v0.0.0-20260928003911-758a51d24cad/go.mod h1:oRPTSZgaEJPhv3dmmNvo6grBq/BemrLG3wFQLMTZJkY= github.com/bdandy/go-errors v1.2.2 h1:WdFv/oukjTJCLa79UfkGmwX7ZxONAihKu4V0mLIs11Q= github.com/bdandy/go-errors v1.2.2/go.mod h1:NkYHl4Fey9oRRdbB1CoC6e84tuqQHiqrOcZpqFEkBxM= github.com/bdandy/go-socks4 v1.2.3 h1:Q6Y2heY1GRjCtHbmlKfnwrKVU/k81LS8mRGLRlmDlic= diff --git a/internal/ui/chat/model.go b/internal/ui/chat/model.go index 3116e07..ccbd5c8 100644 --- a/internal/ui/chat/model.go +++ b/internal/ui/chat/model.go @@ -28,8 +28,8 @@ import ( "github.com/ayn2op/tview/backdrop" "github.com/ayn2op/tview/center" "github.com/ayn2op/tview/column" + "github.com/ayn2op/tview/inert" "github.com/ayn2op/tview/keybind" - "github.com/ayn2op/tview/opaque" "github.com/ayn2op/tview/row" "github.com/ayn2op/tview/stack" ) @@ -457,9 +457,9 @@ func (m Model) View() tview.Element { return main } return stack.New( - main, - // The backdrop keeps clicks from reaching the panes behind the picker. - opaque.New(backdrop.New().Style(m.cfg.Theme.Dialog.BackgroundStyle.Style)), + // The panes behind the picker take no input. + inert.New(main), + backdrop.New().Style(m.cfg.Theme.Dialog.BackgroundStyle.Style), center.New(column.New(picker).Width(tview.Fixed(m.cfg.Picker.Width)).Height(tview.Fixed(m.cfg.Picker.Height))), ) } diff --git a/internal/ui/root/inert.go b/internal/ui/root/inert.go deleted file mode 100644 index 8a3b8a5..0000000 --- a/internal/ui/root/inert.go +++ /dev/null @@ -1,18 +0,0 @@ -package root - -import "github.com/ayn2op/tview" - -// inert draws child but gives it no input, like HTML's inert attribute, for what is behind the dialog. -type inert struct { - child tview.Element -} - -var _ tview.Element = inert{} - -func (i inert) Draw(screen tview.Screen, area tview.Rectangle) { - i.child.Draw(screen, area) -} - -func (inert) Handle(msg tview.Msg, area tview.Rectangle) tview.Msg { - return msg -} diff --git a/internal/ui/root/model.go b/internal/ui/root/model.go index 0c30acf..cee6ced 100644 --- a/internal/ui/root/model.go +++ b/internal/ui/root/model.go @@ -17,6 +17,7 @@ import ( "github.com/ayn2op/tview/column" "github.com/ayn2op/tview/dialog" "github.com/ayn2op/tview/help" + "github.com/ayn2op/tview/inert" "github.com/ayn2op/tview/keybind" "github.com/ayn2op/tview/stack" "github.com/gdamore/tcell/v3" @@ -157,7 +158,7 @@ func (m Model) View() tview.Element { if m.modal == nil { return content } - return stack.New(inert{content}, backdrop.New().Style(m.cfg.Theme.Dialog.BackgroundStyle.Style), m.dialogView()) + return stack.New(inert.New(content), backdrop.New().Style(m.cfg.Theme.Dialog.BackgroundStyle.Style), m.dialogView()) } func (m *Model) showModal(request ui.ModalMsg) tview.Cmd {