diff options
| author | Vlastimil Ovčáčík <vovcacik@github.ovcacik.org> | 2021-09-21 17:52:39 +0200 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-10-03 01:39:30 +0900 |
| commit | 0ff885461b0474b58f08d7c3f48992a0e1eafee0 (patch) | |
| tree | 730a1209b4c5af4ac8233f15370fc8ea857722f9 /src/tui/tui.go | |
| parent | ca43f95fb1835f74f837e1599a3383b4a7123390 (diff) | |
| download | fzf-0ff885461b0474b58f08d7c3f48992a0e1eafee0.tar.gz | |
Add mouse support to the FullscreenRenderer
Diffstat (limited to 'src/tui/tui.go')
| -rw-r--r-- | src/tui/tui.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/tui/tui.go b/src/tui/tui.go index eb09da40..12359c62 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -5,6 +5,8 @@ import ( "os" "strconv" "time" + + "github.com/gdamore/tcell" ) // Types of user action @@ -397,20 +399,22 @@ type Window interface { } type FullscreenRenderer struct { - theme *ColorTheme - mouse bool - forceBlack bool - prevDownTime time.Time - clickY []int + theme *ColorTheme + mouse bool + forceBlack bool + prevDownTime time.Time + prevMouseButton tcell.ButtonMask + clickY []int } func NewFullscreenRenderer(theme *ColorTheme, forceBlack bool, mouse bool) Renderer { r := &FullscreenRenderer{ - theme: theme, - mouse: mouse, - forceBlack: forceBlack, - prevDownTime: time.Unix(0, 0), - clickY: []int{}} + theme: theme, + mouse: mouse, + forceBlack: forceBlack, + prevDownTime: time.Unix(0, 0), + prevMouseButton: tcell.ButtonNone, + clickY: []int{}} return r } |
