Documentation
¶
Index ¶
- type ColorScheme
- type UI
- func (ui *UI) CycleColorScheme()
- func (ui *UI) OpenImage(imagePath string) error
- func (ui *UI) ReRender()
- func (ui *UI) SelectImage(images []string, startLine int, endLine int) (string, error)
- func (ui *UI) SetCapture(f func(event *tcell.EventKey) *tcell.EventKey) func()
- func (ui *UI) SetColorScheme(scheme ColorScheme)
- func (ui *UI) SetStatus(text string)
- func (ui *UI) SetTempContent(view tview.Primitive) func()
- func (ui *UI) SetTempStatus(views ...tview.Primitive) func()
- func (ui *UI) SetWidth(width int)
- func (ui *UI) ShowHelp() error
- func (ui *UI) ShowImageSelect(images []string, callback func(string)) error
- func (ui *UI) ShowMetadata(metadata [][]string) error
- func (ui *UI) ShowSearch(cb func()) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorScheme ¶
type ColorScheme int
ColorScheme represents a color scheme
const ( // DefaultColorScheme is the default color scheme DefaultColorScheme ColorScheme = iota // DarkColorScheme is the dark color scheme DarkColorScheme // LightColorScheme is the light color scheme LightColorScheme )
type UI ¶
type UI struct {
App *tview.Application
Container *tview.Flex
Horizontal *tview.Flex
Content *tview.Flex
LeftPanel *tview.Box
RightPanel *tview.Box
TextArea *tview.TextView
StatusBar *tview.TextView
SearchInput *tview.InputField // VIM style search input
ColorScheme ColorScheme
Width int
JumpList map[rune][4]interface{} // [index, width, pos, pctg]
SearchPattern string
Images []string // Images in the current chapter
IsSearchMode bool // Mark if the search mode is active
CountPrefix int // Numeric prefix for commands like [count]=
ReadChapter func(index int, pctg float64) error // Chapter to jump to
}
UI represents the user interface
func (*UI) CycleColorScheme ¶
func (ui *UI) CycleColorScheme()
CycleColorScheme cycles through the color schemes
func (*UI) SelectImage ¶
SelectImage shows a dialog to select an image
func (*UI) SetCapture ¶
func (ui *UI) SetCapture(f func(event *tcell.EventKey) *tcell.EventKey) func()
SetCapture sets the input capture function return a function to restore the original input capture
func (*UI) SetColorScheme ¶
func (ui *UI) SetColorScheme(scheme ColorScheme)
SetColorScheme sets the color scheme
func (*UI) SetTempContent ¶
SetTempContent sets a temporary content
func (*UI) SetTempStatus ¶
Make text display a norm for the Status Bar This method is used to set a temporary new Status Bar It will return a restoration method
func (*UI) ShowImageSelect ¶
ShowImageSelect shows an input dialog for selecting an image by number
func (*UI) ShowMetadata ¶
ShowMetadata shows the metadata
func (*UI) ShowSearch ¶
ShowSearch shows the search dialog in VIM style