Documentation
¶
Index ¶
- Constants
- Variables
- func Capitalize(s string) string
- func FixedWidth(text string, width int) string
- type ActionHandler
- type ActionOpts
- type ActionOptsFn
- type Application
- func (a *Application) Alert(msg string, after tview.Primitive)
- func (a *Application) AsKey(evt *tcell.EventKey) tcell.Key
- func (a *Application) Confirm(msg string, onConfirm, onCancel func())
- func (a *Application) HasAction(key tcell.Key) (KeyAction, bool)
- func (a *Application) HideLoading(name string)
- func (a *Application) Info(msg string, after tview.Primitive)
- func (a *Application) IsTopDialog() bool
- func (a *Application) Run() error
- func (a *Application) ShowLoading(message string, name string)
- func (a *Application) SwitchPage(page string)
- type Installer
- type KeyAction
- type KeyActions
- func (a *KeyActions) Add(key tcell.Key, action KeyAction)
- func (a *KeyActions) Clear()
- func (a *KeyActions) Delete(keys ...tcell.Key)
- func (a *KeyActions) Get(key tcell.Key) (KeyAction, bool)
- func (a *KeyActions) Len() int
- func (a *KeyActions) Merge(as *KeyActions)
- func (a *KeyActions) Range(f RandFn)
- type KeyMap
- type LanguageVersions
- func (lv *LanguageVersions) Filter(k, v string)
- func (lv *LanguageVersions) GetData(ctx context.Context, lang core.Language) (*LanguageVersions, error)
- func (lv *LanguageVersions) GetRow(i []string) interface{}
- func (lv *LanguageVersions) GetRowColor(i []string) tcell.Color
- func (lv *LanguageVersions) Headers() []*TableHeader
- func (lv *LanguageVersions) RowCount() int
- func (lv *LanguageVersions) Rows() [][]string
- func (lv *LanguageVersions) Title() string
- type Languages
- type Page
- type PageLanguageVersions
- type PageLanguages
- type RandFn
- type SearchTable
- func (t *SearchTable) BindKeys(km KeyMap)
- func (t *SearchTable) GetModel() Tabular
- func (t *SearchTable) GetRowCount() int
- func (t *SearchTable) GetSelection() (interface{}, bool)
- func (t *SearchTable) Render()
- func (t *SearchTable) Select(row, column int)
- func (t *SearchTable) SetModel(model Tabular)
- type TableHeader
- type Tabular
Constants ¶
View Source
const ( KeyHelp tcell.Key = 63 KeySpace tcell.Key = 32 KeySlash tcell.Key = 47 KeyColon tcell.Key = 58 KeyColonQ tcell.Key = 59 )
View Source
const ( Key0 tcell.Key = iota + 48 Key1 Key2 Key3 Key4 Key5 Key6 Key7 Key8 Key9 )
View Source
const ( KeyA tcell.Key = iota + 97 KeyB KeyC KeyD KeyE KeyF KeyG KeyH KeyI KeyJ KeyK KeyL KeyM KeyN KeyO KeyP KeyQ KeyR KeyS KeyT KeyU KeyV KeyW KeyX KeyY KeyZ )
View Source
const ( KeyShiftA tcell.Key = iota + 65 KeyShiftB KeyShiftC KeyShiftD KeyShiftE KeyShiftF KeyShiftG KeyShiftH KeyShiftI KeyShiftJ KeyShiftK KeyShiftL KeyShiftM KeyShiftN KeyShiftO KeyShiftP KeyShiftQ KeyShiftR KeyShiftS KeyShiftT KeyShiftU KeyShiftV KeyShiftW KeyShiftX KeyShiftY KeyShiftZ )
Variables ¶
View Source
var ActionNil = func(evt *tcell.EventKey) *tcell.EventKey { return evt }
View Source
var Borders = struct { Horizontal rune Vertical rune TopLeft rune TopRight rune BottomLeft rune BottomRight rune LeftT rune RightT rune TopT rune BottomT rune Cross rune HorizontalFocus rune VerticalFocus rune TopLeftFocus rune TopRightFocus rune BottomLeftFocus rune BottomRightFocus rune }{ Horizontal: tview.BoxDrawingsLightHorizontal, Vertical: tview.BoxDrawingsLightVertical, TopLeft: tview.BoxDrawingsLightDownAndRight, TopRight: tview.BoxDrawingsLightDownAndLeft, BottomLeft: tview.BoxDrawingsLightUpAndRight, BottomRight: tview.BoxDrawingsLightUpAndLeft, LeftT: tview.BoxDrawingsLightVerticalAndRight, RightT: tview.BoxDrawingsLightVerticalAndLeft, TopT: tview.BoxDrawingsLightDownAndHorizontal, BottomT: tview.BoxDrawingsLightUpAndHorizontal, Cross: tview.BoxDrawingsLightVerticalAndHorizontal, HorizontalFocus: tview.BoxDrawingsLightHorizontal, VerticalFocus: tview.BoxDrawingsLightVertical, TopLeftFocus: tview.BoxDrawingsLightDownAndRight, TopRightFocus: tview.BoxDrawingsLightDownAndLeft, BottomLeftFocus: tview.BoxDrawingsLightUpAndRight, BottomRightFocus: tview.BoxDrawingsLightUpAndLeft, }
Functions ¶
func Capitalize ¶
func FixedWidth ¶
Types ¶
type ActionOpts ¶
type ActionOptsFn ¶
type ActionOptsFn func(opts *ActionOpts)
func WithDefault ¶
func WithDefault() ActionOptsFn
func WithDisplayName ¶
func WithDisplayName(displayName string) ActionOptsFn
type Application ¶
type Application struct {
*tview.Application
// contains filtered or unexported fields
}
func CreateApplication ¶
func CreateApplication(ctx context.Context) *Application
func (*Application) Confirm ¶
func (a *Application) Confirm(msg string, onConfirm, onCancel func())
func (*Application) HideLoading ¶
func (a *Application) HideLoading(name string)
HideLoading 隐藏Loading
func (*Application) IsTopDialog ¶
func (a *Application) IsTopDialog() bool
func (*Application) Run ¶
func (a *Application) Run() error
func (*Application) ShowLoading ¶
func (a *Application) ShowLoading(message string, name string)
ShowLoading Loading(带动画)
func (*Application) SwitchPage ¶
func (a *Application) SwitchPage(page string)
type Installer ¶
func NewInstall ¶
func NewInstall( app *Application, pages *tview.Pages, lang core.Language, version *core.RemoteVersion, callback func(err error), ) *Installer
type KeyAction ¶
type KeyAction struct {
Description string
Action ActionHandler
Opts ActionOpts
}
func NewKeyAction ¶
func NewKeyAction(d string, a ActionHandler, visible bool, opts ...ActionOptsFn) KeyAction
func NewKeyActionWithOpts ¶
func NewKeyActionWithOpts(d string, a ActionHandler, opts ActionOpts, optsFn ...ActionOptsFn) KeyAction
type KeyActions ¶
type KeyActions struct {
// contains filtered or unexported fields
}
func NewKeyActions ¶
func NewKeyActions() *KeyActions
func NewKeyActionsFromMap ¶
func NewKeyActionsFromMap(m KeyMap) *KeyActions
func (*KeyActions) Clear ¶
func (a *KeyActions) Clear()
func (*KeyActions) Delete ¶
func (a *KeyActions) Delete(keys ...tcell.Key)
func (*KeyActions) Len ¶
func (a *KeyActions) Len() int
func (*KeyActions) Merge ¶
func (a *KeyActions) Merge(as *KeyActions)
func (*KeyActions) Range ¶
func (a *KeyActions) Range(f RandFn)
type LanguageVersions ¶
type LanguageVersions struct {
// contains filtered or unexported fields
}
func NewLanguageVersions ¶
func NewLanguageVersions() *LanguageVersions
func (*LanguageVersions) Filter ¶
func (lv *LanguageVersions) Filter(k, v string)
func (*LanguageVersions) GetData ¶
func (lv *LanguageVersions) GetData(ctx context.Context, lang core.Language) (*LanguageVersions, error)
func (*LanguageVersions) GetRow ¶
func (lv *LanguageVersions) GetRow(i []string) interface{}
func (*LanguageVersions) GetRowColor ¶
func (lv *LanguageVersions) GetRowColor(i []string) tcell.Color
func (*LanguageVersions) Headers ¶
func (lv *LanguageVersions) Headers() []*TableHeader
func (*LanguageVersions) RowCount ¶
func (lv *LanguageVersions) RowCount() int
func (*LanguageVersions) Rows ¶
func (lv *LanguageVersions) Rows() [][]string
func (*LanguageVersions) Title ¶
func (lv *LanguageVersions) Title() string
type Languages ¶
type Languages struct {
// contains filtered or unexported fields
}
func NewLanguages ¶
func NewLanguages() *Languages
func (*Languages) Headers ¶
func (l *Languages) Headers() []*TableHeader
type PageLanguageVersions ¶
type PageLanguageVersions struct {
*SearchTable
// contains filtered or unexported fields
}
func NewPageLanguageVersions ¶
func NewPageLanguageVersions(app *Application) *PageLanguageVersions
func (*PageLanguageVersions) GetKeyActions ¶
func (p *PageLanguageVersions) GetKeyActions() *KeyActions
func (*PageLanguageVersions) Init ¶
func (p *PageLanguageVersions) Init(ctx context.Context)
type PageLanguages ¶
type PageLanguages struct {
*SearchTable
// contains filtered or unexported fields
}
func NewPageLanguages ¶
func NewPageLanguages(app *Application) *PageLanguages
func (*PageLanguages) GetKeyActions ¶
func (p *PageLanguages) GetKeyActions() *KeyActions
func (*PageLanguages) Init ¶
func (p *PageLanguages) Init(ctx context.Context)
type SearchTable ¶
func NewSearchTable ¶
func NewSearchTable(model Tabular, app *Application) *SearchTable
func (*SearchTable) BindKeys ¶
func (t *SearchTable) BindKeys(km KeyMap)
func (*SearchTable) GetModel ¶
func (t *SearchTable) GetModel() Tabular
func (*SearchTable) GetRowCount ¶
func (t *SearchTable) GetRowCount() int
func (*SearchTable) GetSelection ¶
func (t *SearchTable) GetSelection() (interface{}, bool)
func (*SearchTable) Render ¶
func (t *SearchTable) Render()
func (*SearchTable) Select ¶
func (t *SearchTable) Select(row, column int)
func (*SearchTable) SetModel ¶
func (t *SearchTable) SetModel(model Tabular)
type TableHeader ¶
Click to show internal directories.
Click to hide internal directories.