Documentation ¶
Index ¶
- Variables
- func Batch(ev ...Event)
- func EachFileList(fn func(int, *List))
- func SetColors(cs map[string]*Color)
- type BatchTaskItem
- type Bookmark
- type Box
- type Clip
- type Color
- type Column
- type ColumnItem
- type Drawable
- type Drawer
- type Event
- type EventType
- type FileList
- type FloatText
- type FlowLayout
- type HLine
- type JumpItem
- type Keyed
- type Label
- type List
- type Path
- type Point
- func (p *Point) Down() *Point
- func (p *Point) DownN(n int) *Point
- func (p *Point) Equals(o *Point) bool
- func (p *Point) Left() *Point
- func (p *Point) LeftN(n int) *Point
- func (p *Point) MoveDown() *Point
- func (p *Point) MoveDownN(n int) *Point
- func (p *Point) MoveLeft() *Point
- func (p *Point) MoveLeftN(n int) *Point
- func (p *Point) MoveRight() *Point
- func (p *Point) MoveRightN(n int) *Point
- func (p *Point) MoveUp() *Point
- func (p *Point) MoveUpN(n int) *Point
- func (p *Point) Right() *Point
- func (p *Point) RightN(n int) *Point
- func (p *Point) To(p2 *Point) *Rect
- func (p *Point) ToRect() *Rect
- func (p *Point) Up() *Point
- func (p *Point) UpN(n int) *Point
- type Popup
- type ProgressBar
- type Rect
- type RightAlignFlowLayout
- type Status
- type StatusBackup
- type StatusItem
- type Tab
- type Task
- type TaskItem
- type Text
- type UI
- type VLine
- type VerticalLayout
Constants ¶
This section is empty.
Variables ¶
var ( // Gui event chan Gui = make(chan Event) // GuiQuit chan GuiQuit = make(chan bool) // GuiAck gui render finish ack GuiAck = make(chan bool) )
var ( // ColorDefault default color ColorDefault = &Color{termbox.ColorDefault, termbox.ColorDefault} )
var ( // ZeroPoint x and y all are 0 ZeroPoint = &Point{0, 0} )
Functions ¶
Types ¶
type BatchTaskItem ¶
type BatchTaskItem struct { *Drawable // contains filtered or unexported fields }
BatchTaskItem render a batch task
func NewBatchTaskItem ¶
func NewBatchTaskItem(p *Point, max, width int) *BatchTaskItem
NewBatchTaskItem create batch task
type Bookmark ¶
type Bookmark struct {
Width, Height int
List *List
*Drawable
// contains filtered or unexported fields
}
Bookmark ui
func NewBookmark ¶
NewBookmark create bookmark
type Box ¶
type Box struct { *Drawable // contains filtered or unexported fields }
Box rect with border
type ColumnItem ¶
type ColumnItem struct { *Drawable // contains filtered or unexported fields }
ColumnItem a item
type Drawer ¶
type Drawer interface { Draw() *Point Clear() // contains filtered or unexported methods }
Drawer is the base interface for ui components
type EventType ¶
type EventType uint8
EventType event type
const ( // BatchEvent multiple message BatchEvent EventType = iota // MessageEvent Data: string MessageEvent // ChangeGroupEvent Data: model.Workspace ChangeGroupEvent // ColumnContentChangeEvent Data: model.Column the current column ColumnContentChangeEvent // ToggleDetailEvent Data: model.Column the current column ToggleDetailEvent // ChangeSelectEvent Data: model.Column the current column ChangeSelectEvent // OpenRightEvent Data: model.Group current group OpenRightEvent // CloseRightEvent Data: model.Column, the new current colunn CloseRightEvent // ToParentEvent Data: model.Column, the current column ToParentEvent // ShiftEvent Data: model.Group ShiftEvent // JumpToEvent Data: model.Group JumpToEvent // ChangeRootEvent Data: model.Group ChangeRootEvent // ToggleBookmarkEvent Data: bool if to show bookmark ToggleBookmarkEvent // InputChangeEvent Data: [name string, value string] InputChangeEvent // QuitInputEvent Data: model.Column QuitInputEvent // BookmarkChangedEvent Data: model.Bookmark BookmarkChangedEvent // JumpRefreshEvent Data: JumpRefreshEvent // ClipChangedEvent clip changed Data CopySource ClipChangedEvent // TaskChangedEvent Data: TaskManager TaskChangedEvent // ToggleTaskDetailEvent Data: bool ToggleTaskDetailEvent // ShowHelpEvent Data: bool ShowHelpEvent // ToggleClipDetailEvent Data: bool ToggleClipDetailEvent )
type FileList ¶
type FileList struct { *Drawable // contains filtered or unexported fields }
FileList is a list of file
type FloatText ¶
type FloatText struct { *Text // contains filtered or unexported fields }
FloatText restore the cells after clear
func NewFloatText ¶
NewFloatText create float text
type FlowLayout ¶
type FlowLayout struct { LeftPadding int RightPadding int *Drawable // contains filtered or unexported fields }
FlowLayout layout from left to right
func NewFlowLayout ¶
func NewFlowLayout(p *Point, padding func(*Point) *Point, items ...Drawer) *FlowLayout
NewFlowLayout create flow layout
type HLine ¶
type HLine struct { *Text // contains filtered or unexported fields }
HLine horizontal line
func (*HLine) ChangeWidth ¶
ChangeWidth change the line width
type List ¶
type List struct { Selected int Height int Data []string *Drawable // contains filtered or unexported fields }
List a list of string
type Point ¶
type Point struct {
X, Y int
}
Point represent a point in screen
func (*Point) MoveRightN ¶
MoveRightN moves the current point to the right by N and reterns it self
type ProgressBar ¶
type ProgressBar struct { Width int Progress int *Drawable // contains filtered or unexported fields }
ProgressBar a progress bar
func NewProgressBar ¶
func NewProgressBar(p *Point, width, progress int) *ProgressBar
NewProgressBar create progress bar
type RightAlignFlowLayout ¶
type RightAlignFlowLayout struct { *FlowLayout Start *Point }
RightAlignFlowLayout right align
func NewRightAlignFlowLayout ¶
func NewRightAlignFlowLayout(p *Point, padding func(*Point) *Point, items ...Drawer) *RightAlignFlowLayout
NewRightAlignFlowLayout create right align flow layout
type StatusBackup ¶
type StatusBackup struct {
// contains filtered or unexported fields
}
StatusBackup backup status bar state
type StatusItem ¶
type StatusItem struct { *Text // contains filtered or unexported fields }
StatusItem item in status bar
type Task ¶
type Task struct { *Text // contains filtered or unexported fields }
Task ui
type TaskItem ¶
type TaskItem struct { *Drawable // contains filtered or unexported fields }
TaskItem render a task
func NewTaskItem ¶
NewTaskItem create task item
type UI ¶
type UI struct { Tab *Tab Path *Path Clip *Clip Task *Task Column *Column Bookmark *Bookmark Status *Status StatusMessage *StatusBackup StatusInput *StatusBackup // contains filtered or unexported fields }
UI hold all ui items
type VLine ¶
type VLine struct { *Drawable // contains filtered or unexported fields }
VLine vertical line
type VerticalLayout ¶
type VerticalLayout struct {
TopPadding, BottomPadding int
*Drawable
// contains filtered or unexported fields
}
VerticalLayout vertical flow layout
func NewVerticalLayout ¶
func NewVerticalLayout(p *Point, padding func(*Point) *Point, items ...Drawer) *VerticalLayout
NewVerticalLayout create flow layout