|
|
|
@ -29,7 +29,7 @@ var DefaultTransactionsColumns = []string{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Transactions struct {
|
|
|
|
|
col int
|
|
|
|
|
current int
|
|
|
|
|
columns []transactionsColumn
|
|
|
|
|
columnsView *gocui.View
|
|
|
|
|
view *gocui.View
|
|
|
|
@ -66,12 +66,12 @@ func (c *Transactions) CursorUp() error {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Transactions) CursorRight() error {
|
|
|
|
|
if c.col > len(c.columns)-1 {
|
|
|
|
|
if c.current > len(c.columns)-1 {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
speed := c.columns[c.col].width + 1
|
|
|
|
|
if c.col == len(c.columns)-1 {
|
|
|
|
|
speed := c.columns[c.col].width + 1
|
|
|
|
|
speed := c.columns[c.current].width + 1
|
|
|
|
|
if c.current == len(c.columns)-1 {
|
|
|
|
|
speed := c.columns[c.current].width + 1
|
|
|
|
|
err := cursorRight(c.columnsView, speed)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
@ -88,7 +88,7 @@ func (c *Transactions) CursorRight() error {
|
|
|
|
|
|
|
|
|
|
return cursorLeft(c.view, speed)
|
|
|
|
|
}
|
|
|
|
|
c.col++
|
|
|
|
|
c.current++
|
|
|
|
|
err := cursorRight(c.columnsView, speed)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
@ -98,11 +98,11 @@ func (c *Transactions) CursorRight() error {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Transactions) CursorLeft() error {
|
|
|
|
|
if c.col == 0 {
|
|
|
|
|
if c.current == 0 {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
speed := c.columns[c.col-1].width + 1
|
|
|
|
|
c.col--
|
|
|
|
|
speed := c.columns[c.current-1].width + 1
|
|
|
|
|
c.current--
|
|
|
|
|
err := cursorLeft(c.columnsView, speed)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
@ -175,7 +175,7 @@ func (c *Transactions) display() {
|
|
|
|
|
c.columnsView.Clear()
|
|
|
|
|
var buffer bytes.Buffer
|
|
|
|
|
for i := range c.columns {
|
|
|
|
|
if c.col == i {
|
|
|
|
|
if c.current == i {
|
|
|
|
|
buffer.WriteString(color.Cyan(color.Background)(c.columns[i].name))
|
|
|
|
|
buffer.WriteString(" ")
|
|
|
|
|
continue
|
|
|
|
@ -190,7 +190,7 @@ func (c *Transactions) display() {
|
|
|
|
|
var buffer bytes.Buffer
|
|
|
|
|
for i := range c.columns {
|
|
|
|
|
var opt color.Option
|
|
|
|
|
if c.col == i {
|
|
|
|
|
if c.current == i {
|
|
|
|
|
opt = color.Bold
|
|
|
|
|
}
|
|
|
|
|
buffer.WriteString(c.columns[i].display(item, opt))
|
|
|
|
|