ui

package
v0.0.0-...-519aebc Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputTextColor = "#ff5faf"
)

Variables

View Source
var (
	StyleHelp            = NewStyle("#4e4e4e", "", true, false)
	StyleMean            = NewStyle("#ffffff", "", false, false)
	StylePart            = NewStyle("#66C2CD", "", false, true)
	StylePhrasesText     = NewStyle("#B9BFCA", "", false, false)
	StyleSentencesText   = NewStyle("#B9BFCA", "", false, false)
	StyleGuessText       = NewStyle("#D290E4", "", false, false)
	StyleGuessTextSelect = NewStyle("#ff5faf", "", true, false)
	StyleKey             = NewStyle("#71BEF2", "", true, false)
	StyleKeyHelp         = NewStyle("#B9BFCA", "", false, false)
	StyleSuccess         = NewStyle("#67f86f", "", true, false)
	Stylefail            = NewStyle("#fd6f59", "", true, false)
	StyleWordCount       = NewStyle("#aeaeae", "", true, false)
)

Functions

func Footer(width int) string

func JoinLines

func JoinLines(texts ...string) string

func Line

func Line(width int, cells ...Cell) string

不能处理中英文夹杂的对齐情况,因为不同字符显示字宽不同

func NewStyle

func NewStyle(fg string, bg string, bold bool, italic bool) func(string) string

func Truncate

func Truncate(old string, n int) string

Types

type Cell

type Cell struct {
	Text  string
	Width int
	Align TextAlign
}

type HelpModel

type HelpModel struct {
	Keyhelp [][]string
	Active  bool
}

func (HelpModel) View

func (m HelpModel) View() string

type HelpMsg

type HelpMsg struct {
}

type TextAlign

type TextAlign int
const (
	LeftAlign TextAlign = iota
	RightAlign
)

func (TextAlign) String

func (ta TextAlign) String() string

type TransModel

type TransModel struct {
	Word wordset.Word
}

func (TransModel) View

func (m TransModel) View() string

type WordMsg

type WordMsg struct {
	wordset.Word
}

Jump to

Keyboard shortcuts

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