menu

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigWidth = 65
View Source
const DefBlinkTime = 50
View Source
const HelpWidth = 40
View Source
const LineWidth = 10
View Source
const ShapeWidth = 12
View Source
const SymbolColorWidth = 15

Variables

View Source
var (
	BlinkCursor string
	BlinkPhase  bool
	BlinkTime   = DefBlinkTime
)
View Source
var (
	FilePath      string
	FileList      map[int]string
	FileListWidth int
)
View Source
var Colors = map[int]string{
	17: "r",
	19: "g",
	21: "b",
}
View Source
var DrawLine = map[cursor.Type]map[Route]map[Route]string{
	cursor.ContinuousLine:       lineList,
	cursor.SmoothContinuousLine: smoothLineList,
	cursor.FatContinuousLine:    fatLineList,
	cursor.DoubleContinuousLine: doubleLineList,
}
View Source
var GVLine = map[string]map[string]string{
	"─": {"v": "│", "g": "─"},
	"━": {"v": "┃", "g": "━"},
	"═": {"v": "║", "g": "═"},
}
View Source
var GetRoute = map[int]map[int]Route{

	-1: {
		-1: upLeft,
		1:  upRight,
		0:  up,
	},
	1: {
		-1: downLeft,
		1:  downRight,
		0:  down,
	},
	0: {
		-1: left,
		1:  right,
		0:  stay,
	},
}
View Source
var LineList = map[int]LineStruct{
	3: {
		LineType: cursor.Dot,
		LineMenu: "•",
	},
	5: {
		LineType: cursor.SmoothContinuousLine,
		LineMenu: "╭─╯",
		Cursor:   "─",
	},
	7: {
		LineType: cursor.ContinuousLine,
		LineMenu: "┌─┘",
		Cursor:   "─",
	},
	9: {
		LineType: cursor.FatContinuousLine,
		LineMenu: "┏━┛",
		Cursor:   "━",
	},
	11: {
		LineType: cursor.DoubleContinuousLine,
		LineMenu: "╔═╝",
		Cursor:   "═",
	},
}
View Source
var ShapeList = map[int]ShapeStruct{
	3:  {ShapeType: cursor.Dot, ShapeSymbol: "\uF444"},
	5:  {ShapeType: cursor.GLine, ShapeSymbol: "━━"},
	7:  {ShapeType: cursor.VLine, ShapeSymbol: "┃"},
	9:  {ShapeType: cursor.ESquare, ShapeSymbol: "\uEA72"},
	11: {ShapeType: cursor.FSquare, ShapeSymbol: "\U000F0764"},
	13: {ShapeType: cursor.ECircle, ShapeSymbol: "\uEABC"},
	15: {ShapeType: cursor.FCircle, ShapeSymbol: "\uF111"},
	17: {ShapeType: cursor.Fill, ShapeSymbol: "\U000F0266"},
}

Functions

func Blink()

func ClearMenu

func ClearMenu(s Screen, screen [][]string, width int) [][]string

func DrawMenu

func DrawMenu(s Screen)

func DrawSaveInput added in v1.2.2

func DrawSaveInput(screen [][]string) [][]string

func SaveImage

func SaveImage(m Message, imageSaveDirectory string, image string)

Types

type InputStruct

type InputStruct struct {
	Lock  bool
	Value string
	Color string
}
var Input InputStruct

type LineStruct

type LineStruct struct {
	LineType cursor.Type
	LineMenu string
	Cursor   string
}
type MenuType int
const (
	None MenuType = iota
	SymbolColor
	File
	Help
	Shape
	Line
	Config
)
var Type MenuType

type Message added in v1.2.6

type Message interface {
	SetMessage(string)
}

type Route

type Route int

type Screen added in v1.2.6

type Screen interface {
	GetPixels() [][]string
	GetDirectory() string
	SetDirectory(directory string)
	GetHeight() int
	GetWidth() int
	GetConfig() *config.Config
	GetMessage() message.Message
}

type ShapeStruct

type ShapeStruct struct {
	ShapeType   cursor.Type
	ShapeSymbol string
}

Jump to

Keyboard shortcuts

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