ui

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomMetadataFields = make([]string, 0)

Functions

func ShortTimeSince

func ShortTimeSince(t time.Time) string

ShortTimeSince returns human readable format for time.

func TimeSince

func TimeSince(t time.Time) string

PrettyTime shows time in relative / pretty mode.

Types

type BookmarkTable

type BookmarkTable struct {
	// contains filtered or unexported fields
}

func NewBookmarkTable

func NewBookmarkTable(openMetadata func(bookmark *models.Bookmark)) *BookmarkTable

func (*BookmarkTable) Blur

func (b *BookmarkTable) Blur()

func (*BookmarkTable) Draw

func (b *BookmarkTable) Draw(screen tcell.Screen)

func (*BookmarkTable) Focus

func (b *BookmarkTable) Focus(delegate func(p tview.Primitive))

func (*BookmarkTable) GetFocusable

func (b *BookmarkTable) GetFocusable() tview.Focusable

func (*BookmarkTable) GetRect

func (b *BookmarkTable) GetRect() (int, int, int, int)

func (*BookmarkTable) GetSelection

func (b *BookmarkTable) GetSelection() *models.Bookmark

func (*BookmarkTable) InputHandler

func (b *BookmarkTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*BookmarkTable) ResetCursor

func (b *BookmarkTable) ResetCursor()

func (*BookmarkTable) SetData

func (b *BookmarkTable) SetData(data []*models.Bookmark)

func (*BookmarkTable) SetDeleteFunc

func (b *BookmarkTable) SetDeleteFunc(delete func(bookmark *models.Bookmark))

func (*BookmarkTable) SetRect

func (b *BookmarkTable) SetRect(x, y, width, height int)

func (*BookmarkTable) SetSortFunc

func (b *BookmarkTable) SetSortFunc(sort func(column string, sort twidgets.Sort))

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

Metadata provides a form-like view to bookmark metadata

func NewMetadata

func NewMetadata(doneFunc func(save bool, bookmark *models.Bookmark) bool) *Metadata

func (*Metadata) Blur

func (m *Metadata) Blur()

func (*Metadata) Draw

func (m *Metadata) Draw(screen tcell.Screen)

func (*Metadata) Focus

func (m *Metadata) Focus(delegate func(p tview.Primitive))

func (*Metadata) GetFocusable

func (m *Metadata) GetFocusable() tview.Focusable

func (*Metadata) GetRect

func (m *Metadata) GetRect() (int, int, int, int)

func (*Metadata) InputHandler

func (m *Metadata) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*Metadata) SetRect

func (m *Metadata) SetRect(x, y, width, height int)

func (*Metadata) SetSearchFunc

func (m *Metadata) SetSearchFunc(searchFunc func(key, value string) ([]string, error))

type Projects

type Projects struct {
	// contains filtered or unexported fields
}

func NewProjects

func NewProjects() *Projects

func (*Projects) Blur

func (p *Projects) Blur()

func (*Projects) Draw

func (p *Projects) Draw(screen tcell.Screen)

func (*Projects) Focus

func (p *Projects) Focus(delegate func(p tview.Primitive))

func (*Projects) GetFocusable

func (p *Projects) GetFocusable() tview.Focusable

func (*Projects) GetRect

func (p *Projects) GetRect() (int, int, int, int)

func (*Projects) InputHandler

func (p *Projects) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*Projects) SetData

func (p *Projects) SetData(projects []*models.Project)

func (*Projects) SetRect

func (p *Projects) SetRect(x, y, width, height int)

func (*Projects) SetSelectFunc

func (p *Projects) SetSelectFunc(selectFunc func(project *models.Project))
type Search struct {
	*tview.InputField
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(searchFunc func(query string)) *Search

func (*Search) Clear

func (s *Search) Clear()

func (*Search) Done

func (s *Search) Done(key tcell.Key)

type Tags

type Tags struct {
	// contains filtered or unexported fields
}

func NewTags

func NewTags() *Tags

func (*Tags) Blur

func (t *Tags) Blur()

func (*Tags) Draw

func (t *Tags) Draw(screen tcell.Screen)

func (*Tags) Focus

func (t *Tags) Focus(delegate func(p tview.Primitive))

func (*Tags) GetFocusable

func (t *Tags) GetFocusable() tview.Focusable

func (*Tags) GetRect

func (t *Tags) GetRect() (int, int, int, int)

func (*Tags) InputHandler

func (t *Tags) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*Tags) SetData

func (t *Tags) SetData(tags *map[string]int)

func (*Tags) SetRect

func (t *Tags) SetRect(x, y, width, height int)

type Window

type Window struct {
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow(colors config.Colors, shortcuts *config.Shortcuts, db *storage.Database) *Window

func (*Window) Blur

func (w *Window) Blur()

func (*Window) Draw

func (w *Window) Draw(screen tcell.Screen)

func (*Window) FilterByProject

func (w *Window) FilterByProject(project *models.Project)

func (*Window) Focus

func (w *Window) Focus(delegate func(p tview.Primitive))

func (*Window) GetFocusable

func (w *Window) GetFocusable() tview.Focusable

func (*Window) GetRect

func (w *Window) GetRect() (int, int, int, int)

func (*Window) InputHandler

func (w *Window) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*Window) RefreshBookmarks

func (w *Window) RefreshBookmarks()

func (*Window) Run

func (w *Window) Run() error

func (*Window) Search

func (w *Window) Search(text string)

func (*Window) SetRect

func (w *Window) SetRect(x, y, width, height int)

func (*Window) SortBookmarks

func (w *Window) SortBookmarks(column string, sort twidgets.Sort)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL