Fixed mouse handling bug for drop-downs. Removed 404s from readme. Fixed #761

This commit is contained in:
Oliver 2022-09-16 10:15:18 +02:00
parent 55965cf21d
commit 2e69b7385a
2 changed files with 6 additions and 6 deletions

View File

@ -54,10 +54,8 @@ For a presentation highlighting this package, compile and run the program found
- [IRCCloud Terminal Client](https://github.com/termoose/irccloud)
- [Window manager for `tview`](https://github.com/epiclabs-io/winman)
- [Password manager](https://github.com/7onetella/password)
- [CLI bookmark manager](https://github.com/Endi1/drawer)
- [A caving database interface written in Go](https://github.com/IdlePhysicist/cave-logger)
- [App for rental of electic bikes](https://github.com/MrDienns/bike-commerce)
- [Interactive file browse and exec any command.](https://github.com/bannzai/itree)
- [A simple CRM](https://github.com/broadcastle/crm)
- [Terminal UI for todist](https://github.com/cyberdummy/todoista)
@ -82,7 +80,6 @@ For a presentation highlighting this package, compile and run the program found
- [A simple Kanban board for your terminal](https://github.com/witchard/toukan)
- [The personal information dashboard for your terminal. ](https://github.com/wtfutil/wtf)
- [MySQL database to Golang struct](https://github.com/xxjwxc/gormt)
- [Cryptowatch Go SDK](https://github.com/y3sh/cw-sdk-go)
- [Discord, TUI and SIXEL.](https://gitlab.com/diamondburned/6cord)
- [A CLI Audio Player](https://www.github.com/dhulihan/grump)
- [GLab, a GitLab CLI tool](https://gitlab.com/profclems/glab)
@ -104,7 +101,7 @@ For a presentation highlighting this package, compile and run the program found
- [tvxwidgets: tview extra widgets](https://github.com/navidys/tvxwidgets)
- [Domino card game on terminal](https://github.com/gusti-andika/card-domino.git)
- [goaround: Query stackoverflow API and get results on terminal](https://github.com/glendsoza/goaround)
- [resto: 🔗 a CLI app can send pretty HTTP & API requests with TUI](https://github.com/abdfnx/resto)
- [resto: a CLI app can send pretty HTTP & API requests with TUI](https://github.com/abdfnx/resto)
- [twad: a WAD launcher for the terminal](https://github.com/zmnpl/twad)
- [pacseek: A TUI for searching and installing Arch Linux packages](https://github.com/moson-mo/pacseek)
- [7GUIs demo](https://github.com/letientai299/7guis/tree/master/tui)

View File

@ -547,7 +547,11 @@ func (d *DropDown) MouseHandler() func(action MouseAction, event *tcell.EventMou
return d.InRect(x, y), nil // No, and it's not expanded either. Ignore.
}
// Handle dragging. Clicks are implicitly handled by this logic.
// As long as the drop-down is open, we capture all mouse events.
if d.open {
capture = d
}
switch action {
case MouseLeftDown:
consumed = d.open || inRect
@ -564,7 +568,6 @@ func (d *DropDown) MouseHandler() func(action MouseAction, event *tcell.EventMou
// dragging. Because we don't act upon it, it's not a problem.
d.list.MouseHandler()(MouseLeftClick, event, setFocus)
consumed = true
capture = d
}
case MouseLeftUp:
if d.dragging {