tooey

package
v0.0.0-...-020cec0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OldTheme = RootOldTheme{
	Default: NewStyle(ColorWhite),

	Block: BlockOldTheme{
		Title:  NewStyle(ColorWhite),
		Border: NewStyle(ColorWhite),
	},

	BarChart: BarChartOldTheme{
		Bars:   StandardColors,
		Nums:   StandardStyles,
		Labels: StandardStyles,
	},

	Paragraph: ParagraphOldTheme{
		Text: NewStyle(ColorWhite),
	},

	PieChart: PieChartOldTheme{
		Slices: StandardColors,
	},

	List: ListOldTheme{
		Text: NewStyle(ColorWhite),
	},

	Tree: TreeOldTheme{
		Text:      NewStyle(ColorWhite),
		Collapsed: COLLAPSED,
		Expanded:  EXPANDED,
	},

	StackedBarChart: StackedBarChartOldTheme{
		Bars:   StandardColors,
		Nums:   StandardStyles,
		Labels: StandardStyles,
	},

	Gauge: GaugeOldTheme{
		Bar:   ColorWhite,
		Label: NewStyle(ColorWhite),
	},

	Sparkline: SparklineOldTheme{
		Title: NewStyle(ColorWhite),
		Line:  ColorWhite,
	},

	Plot: PlotOldTheme{
		Lines: StandardColors,
		Axes:  ColorWhite,
	},

	Table: TableOldTheme{
		Text: NewStyle(ColorWhite),
	},

	Tab: TabOldTheme{
		Active:   NewStyle(ColorRed),
		Inactive: NewStyle(ColorWhite),
	},
}

OldTheme holds the default Styles and Colors for all widgets. You can set default widget Styles by modifying the OldTheme before creating the widgets.

View Source
var StandardColors = []tcell.Color{
	ColorRed,
	ColorGreen,
	ColorYellow,
	ColorBlue,
	ColorMagenta,
	ColorCyan,
	ColorWhite,
}
View Source
var StandardStyles = []Style{
	NewStyle(ColorRed),
	NewStyle(ColorGreen),
	NewStyle(ColorYellow),
	NewStyle(ColorBlue),
	NewStyle(ColorMagenta),
	NewStyle(ColorCyan),
	NewStyle(ColorWhite),
}

Functions

This section is empty.

Types

type BarChartOldTheme

type BarChartOldTheme struct {
	Bars   []tcell.Color
	Nums   []Style
	Labels []Style
}

type BlockOldTheme

type BlockOldTheme struct {
	Title  Style
	Border Style
}

type GaugeOldTheme

type GaugeOldTheme struct {
	Bar   tcell.Color
	Label Style
}

type ListOldTheme

type ListOldTheme struct {
	Text Style
}

type OldElement

type OldElement struct {
	// Padding allows the drawable borders of an OldElement to be inset
	Padding *Padding

	// OldElementStyle represents the style of the space the OldElement covers
	OldElementStyle Style

	image.Rectangle
	// Inner represents the inner drawable space of an OldElement
	Inner image.Rectangle

	// Border whether or not to draw borders
	Border bool
	// BorderStyle represents the styling to apply to the borders
	BorderStyle Style

	BorderLeft   bool
	BorderRight  bool
	BorderTop    bool
	BorderBottom bool

	// The optional Title of this OldElement which will be rendered in the top row
	Title string
	// TitleStyle represents the style of the title characters - this will override the border it draws on
	TitleStyle Style
	// TitlePadding defines the left and right inset for title drawing
	// top and bottom are unused
	TitlePadding *Padding

	sync.Mutex
}

OldElement is the base struct inherited by most widgets OldElement manages size, position, inner drawable space, borders, and titles All other widgets and ui OldElements will oerride the Draw method

func NewOldElement

func NewOldElement() *OldElement

NewOldElement returns a new stable OldElement that is drawable but can be modified

func (*OldElement) Draw

func (e *OldElement) Draw(s tcell.Screen)

Draw implements the Drawable interface

func (*OldElement) DrawableHeight

func (e *OldElement) DrawableHeight() int

DrawableHeight ...

func (*OldElement) DrawableWidth

func (e *OldElement) DrawableWidth() int

Width ...

func (*OldElement) GetRect

func (e *OldElement) GetRect() image.Rectangle

GetRect implements the Drawable interface

func (*OldElement) SetRect

func (e *OldElement) SetRect(x1 int, y1 int, x2 int, y2 int)

SetRect implements the Drawable interface

func (*OldElement) X1

func (e *OldElement) X1() int

X1 returns the rects Min.X

func (*OldElement) X2

func (e *OldElement) X2() int

X2 returns the rects Max.X

func (*OldElement) Y1

func (e *OldElement) Y1() int

Y1 returns the rects Min.X

func (*OldElement) Y2

func (e *OldElement) Y2() int

Y2 returns the rects Min.X

type ParagraphOldTheme

type ParagraphOldTheme struct {
	Text Style
}

type PieChartOldTheme

type PieChartOldTheme struct {
	Slices []tcell.Color
}

type PlotOldTheme

type PlotOldTheme struct {
	Lines []tcell.Color
	Axes  tcell.Color
}

type RootOldTheme

type RootOldTheme struct {
	Default Style

	Block BlockOldTheme

	BarChart        BarChartOldTheme
	Gauge           GaugeOldTheme
	Plot            PlotOldTheme
	List            ListOldTheme
	Tree            TreeOldTheme
	Paragraph       ParagraphOldTheme
	PieChart        PieChartOldTheme
	Sparkline       SparklineOldTheme
	StackedBarChart StackedBarChartOldTheme
	Tab             TabOldTheme
	Table           TableOldTheme
}

type SparklineOldTheme

type SparklineOldTheme struct {
	Title Style
	Line  tcell.Color
}

type StackedBarChartOldTheme

type StackedBarChartOldTheme struct {
	Bars   []tcell.Color
	Nums   []Style
	Labels []Style
}

type TabOldTheme

type TabOldTheme struct {
	Active   Style
	Inactive Style
}

type TableOldTheme

type TableOldTheme struct {
	Text Style
}

type TreeOldTheme

type TreeOldTheme struct {
	Text      Style
	Collapsed rune
	Expanded  rune
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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