hide cursor

trunk
nbsp 2025-01-05 21:12:06 +02:00
parent da04fa7ef5
commit c825888147
No known key found for this signature in database
GPG Key ID: 7184AC1C9835CE48
2 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,7 @@ func (menu *MainMenu) Event(state *ui.State, event vaxis.Event) (processed bool)
} }
func showManpage(state *ui.State) { func showManpage(state *ui.State) {
state.HideCursor()
vt := term.New() vt := term.New()
vt.TERM = os.Getenv("TERM") vt.TERM = os.Getenv("TERM")
vt.Attach(state.PostEvent()) vt.Attach(state.PostEvent())
@ -90,6 +91,7 @@ func showManpage(state *ui.State) {
for ev := range state.Events() { for ev := range state.Events() {
switch ev.(type) { switch ev.(type) {
case term.EventClosed: case term.EventClosed:
state.HideCursor()
state.Window().Clear() state.Window().Clear()
return return
case vaxis.Redraw: case vaxis.Redraw:

View File

@ -76,6 +76,10 @@ func (state *State) Render() {
state.vx.Render() state.vx.Render()
} }
func (state *State) HideCursor() {
state.vx.HideCursor()
}
func (state *State) Window() vaxis.Window { func (state *State) Window() vaxis.Window {
return state.vx.Window() return state.vx.Window()
} }