Documentation ¶
Overview ¶
Package ui contains the primary application logic and user interface for ci.
Index ¶
- func CreateModal(widget tview.Primitive, width, height int) tview.Primitive
- func CreateTitleBox() *tview.TextView
- func GetHelpText(options *options.AppOptions) string
- func GetScrollBarDrawFunc(s Scrollable, getScrollArea func() (width, height int), ...) func(screen tcell.Screen, x, y, width, height int) (int, int, int, int)
- func Run(app *App, appOptions *options.AppOptions) error
- type App
- type DetailsView
- func (d *DetailsView) Clear() *DetailsView
- func (d *DetailsView) GetText(stripAllTags bool) string
- func (d *DetailsView) SetRect(x, y, width, height int)
- func (d *DetailsView) SetText(text string) *DetailsView
- func (d *DetailsView) SetWordWrap(wrapOnWords bool) *DetailsView
- func (d *DetailsView) SetWrap(wrap bool) *DetailsView
- type DirectoryList
- type FilterForm
- type Scrollable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateModal ¶
CreateModal creates a modal dialog that contains a tview.Primitive.
func CreateTitleBox ¶
CreateTitleBox creates and configures the title box of the application that displays the current navigated directory.
func GetHelpText ¶
func GetHelpText(options *options.AppOptions) string
GetHelpText returns the text of the in-app help info.
func GetScrollBarDrawFunc ¶
func GetScrollBarDrawFunc( s Scrollable, getScrollArea func() (width, height int), getScrollPosition func() (vScroll, hScroll int), ) func(screen tcell.Screen, x, y, width, height int) (int, int, int, int)
GetScrollBarDrawFunc returns a handler function responsible for drawing scroll bars on ui components. This handler satisfies the signature for the SetDrawFunc on the underlying tview.Box which most other components are composed of.
Types ¶
type App ¶
type App struct { *tview.Application // contains filtered or unexported fields }
App is an abstraction of the tview.Application with additional functionality.
func (*App) HandleError ¶
HandleError logs errors and gracefully exits the program with a code of 1.
func (*App) PrintAndExit ¶
PrintAndExit prints data to the App's configured output stream and exits the program.
type DetailsView ¶
type DetailsView struct { *tview.TextView LongestLine int LineCount int HasWrap bool HasWordWrap bool }
DetailsView is a wrapper for tview.TextView with better support for scrolling content. Overridden functions of this struct must be called before any inherited functions from tview.TextView.
func CreateDetailsView ¶
func CreateDetailsView() *DetailsView
CreateDetailsView creates a new instance of DetailsView and initializes it with default settings.
func (*DetailsView) Clear ¶
func (d *DetailsView) Clear() *DetailsView
Clear empties the DetailsView content and resets its title to the default value.
func (*DetailsView) GetText ¶
func (d *DetailsView) GetText(stripAllTags bool) string
GetText returns the current text of this DetailsView. If stripAllTags is set to true, any region/color tags are stripped from the text.
func (*DetailsView) SetRect ¶
func (d *DetailsView) SetRect(x, y, width, height int)
SetRect sets the bounds and screen location of the DetailsView.
func (*DetailsView) SetText ¶
func (d *DetailsView) SetText(text string) *DetailsView
SetText sets the content of the DetailsView and recalculates the width and height of that content.
func (*DetailsView) SetWordWrap ¶
func (d *DetailsView) SetWordWrap(wrapOnWords bool) *DetailsView
SetWordWrap sets the word wrap setting in the underlying tview.TextView and recalculates the content width and height.
func (*DetailsView) SetWrap ¶
func (d *DetailsView) SetWrap(wrap bool) *DetailsView
SetWrap sets the wrap setting in the underlying tview.TextView and recalculates the content width and height.
type DirectoryList ¶
DirectoryList is responsible for providing the user interface that enables users to quickly navigate directories and select other options.
func CreateDirectoryList ¶
func CreateDirectoryList( app *App, titleBox *tview.TextView, filter *FilterForm, pages *tview.Pages, details *DetailsView, directoryController dirctrl.DirectoryController, appOptions *options.AppOptions, ) *DirectoryList
CreateDirectoryList creates a new instance of DirectoryList.
func (*DirectoryList) Init ¶
func (d *DirectoryList) Init() *DirectoryList
Init prepares the DirectoryList for usage by initializing data and event handlers.
type FilterForm ¶
FilterForm provides the user interface that enables the user to filter the list of directories in the DirectoryList.
func CreateFilterForm ¶
func CreateFilterForm() *FilterForm
CreateFilterForm creates a new instance of FilterForm and initializes its form fields.
func (*FilterForm) GetText ¶
func (f *FilterForm) GetText() string
GetText returns the text that is in the FilterForm's filterText field.
func (*FilterForm) SetDoneHandler ¶
func (f *FilterForm) SetDoneHandler(handler func(key tcell.Key)) *FilterForm
SetDoneHandler sets a key press event handler for external components to implement when input is completed on the FilterForm.
func (*FilterForm) SetText ¶
func (f *FilterForm) SetText(text string) *FilterForm
SetText sets the text in the FilterForm's filterText field.