m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add mouse support to the FullscreenRenderer

This commit is contained in:
Vlastimil Ovčáčík
2021-09-21 17:52:39 +02:00
committed by Junegunn Choi
parent ca43f95fb1
commit 0ff885461b
2 changed files with 52 additions and 14 deletions

View File

@@ -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
}