tui

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package tui manage text user interface.

Index

Constants

This section is empty.

Variables

View Source
var Set = wire.NewSet(
	NewTUI,
)

Set is shell wire set.

Functions

This section is empty.

Types

type TUI

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

TUI represents a text-based user interface.

func NewTUI

func NewTUI(
	arg *config.Argument,
	fileReader usecase.FileReader,
	fileWriter usecase.FileWriter,
	tableCreator usecase.TableCreator,
	tablesGetter usecase.TablesGetter,
	ddlGetter usecase.TableDDLGetter,
	sqlExecuter usecase.SQLExecutor,
	recordInserter usecase.RecordsInserter,
	historyTableCreator usecase.HistoryTableCreator,
	historyCreator usecase.HistoryCreator,
	historyLister usecase.HistoryLister,
	dbConfig *config.DBConfig,
	colorManager *config.ColorConfig,
) *TUI

NewTUI creates a new TUI instance.

func (*TUI) Run

func (t *TUI) Run() error

Run runs the TUI.

type Theme added in v0.1.5

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

Theme manages the color scheme for the application

func NewTheme added in v0.1.5

func NewTheme(color *config.ColorConfig, app *tview.Application) *Theme

NewTheme creates a new theme manager

func (*Theme) ApplyButtonTheme added in v0.1.5

func (t *Theme) ApplyButtonTheme(button *tview.Button, focused bool)

ApplyButtonTheme apply theme to a button

func (*Theme) ApplyTableTheme added in v0.1.5

func (t *Theme) ApplyTableTheme(table *tview.Table, focused bool)

ApplyTableTheme apply theme to a table

func (*Theme) ApplyTextAreaTheme added in v0.1.5

func (t *Theme) ApplyTextAreaTheme(textArea *tview.TextArea, focused bool)

ApplyTextAreaTheme apply theme to a text area

func (*Theme) ApplyTextViewTheme added in v0.1.5

func (t *Theme) ApplyTextViewTheme(textView *tview.TextView, focused bool)

ApplyTextViewTheme apply theme to a text view

func (*Theme) GetColors added in v0.1.5

func (t *Theme) GetColors() ThemeColors

GetColors returns the current colors based on the active color scheme

func (*Theme) ShowColorSchemeSelector added in v0.1.5

func (t *Theme) ShowColorSchemeSelector(onClose func())

ShowColorSchemeSelector displays a modal for selecting the color scheme with buttons arranged in rows of 4 in the center of the screen

type ThemeColors added in v0.1.5

type ThemeColors struct {
	Background      tcell.Color
	Foreground      tcell.Color
	Border          tcell.Color
	BorderFocus     tcell.Color
	Selection       tcell.Color
	SelectionText   tcell.Color
	Header          tcell.Color
	Button          tcell.Color
	ButtonFocus     tcell.Color
	ButtonText      tcell.Color
	ButtonTextFocus tcell.Color
}

ThemeColors holds the actual tcell.Color values for the application

Jump to

Keyboard shortcuts

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