Remove unused mouse-bindings. Return errors more consistently.

pull/224/head
Simon Roberts 3 years ago
parent 4d4321b48b
commit 3d05f6d04f
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -373,12 +373,7 @@ func (ct *Cointop) SetKeybindings() error {
ct.DeleteKeybindingMod(key, mod, "")
// mouse events
// ct.SetKeybindingMod(gocui.MouseRelease, gocui.ModNone, ct.Keyfn(ct.MouseRelease), "")
ct.SetKeybindingMod(gocui.MouseLeft, gocui.ModNone, ct.Keyfn(ct.MouseLeftClick), ct.Views.Table.Name()) // click to focus
// ct.SetKeybindingMod(gocui.MouseMiddle, gocui.ModNone, ct.Keyfn(ct.MouseMiddleClick), "")
// ct.SetKeybindingMod(gocui.MouseRight, gocui.ModNone, ct.Keyfn(ct.MouseRightClick), "")
// ct.SetKeybindingMod(gocui.MouseWheelUp, gocui.ModNone, ct.Keyfn(ct.MouseWheelUp), "")
// ct.SetKeybindingMod(gocui.MouseWheelDown, gocui.ModNone, ct.Keyfn(ct.MouseWheelDown), "")
// clicking table headers sorts table
ct.SetKeybindingMod(gocui.MouseLeft, gocui.ModNone, ct.Keyfn(ct.TableHeaderMouseLeftClick), ct.Views.TableHeader.Name())

@ -560,35 +560,9 @@ func (ct *Cointop) TableScrollRight() error {
return nil
}
// MouseRelease is called on mouse releae event
func (ct *Cointop) MouseRelease() error {
return nil
}
// MouseLeftClick is called on mouse left click event
func (ct *Cointop) MouseLeftClick() error {
ct.g.SetCursorFromCurrentMouseEvent()
return nil
}
// MouseMiddleClick is called on mouse middle click event
func (ct *Cointop) MouseMiddleClick() error {
return nil
}
// MouseRightClick is called on mouse right click event
func (ct *Cointop) MouseRightClick() error {
return ct.OpenLink()
}
// MouseWheelUp is called on mouse wheel up event
func (ct *Cointop) MouseWheelUp() error {
return nil
}
// MouseWheelDown is called on mouse wheel down event
func (ct *Cointop) MouseWheelDown() error {
return nil
return ct.g.SetCursorFromCurrentMouseEvent()
}
// TableRowsLen returns the number of table row entries

@ -265,7 +265,7 @@ func (ct *Cointop) TableHeaderMouseLeftClick() error {
// Figure out which column they clicked on
if ct.State.columnLookup[x] != "" {
fn := ct.Sortfn(ct.State.columnLookup[x], false)
fn(ct.g, ct.Views.Table.Backing())
return fn(ct.g, ct.Views.Table.Backing())
}
return nil

Loading…
Cancel
Save