style

package
v0.0.0-...-0d1a6d2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Normal            Item
	Hover             Item
	Active            Item
	BorderColor       color.RGBA
	TextBackground    color.RGBA
	TextNormal        color.RGBA
	TextHover         color.RGBA
	TextActive        color.RGBA
	Border            int
	Rounding          uint16
	Padding           image.Point
	ImagePadding      image.Point
	TouchPadding      image.Point
	DrawBegin         func(*command.Buffer)
	Draw              CustomButtonDrawing
	DrawEnd           func(*command.Buffer)
	SymbolBorderWidth int
}

type Chart

type Chart struct {
	Background    Item
	BorderColor   color.RGBA
	SelectedColor color.RGBA
	Color         color.RGBA
	Border        int
	Rounding      uint16
	Padding       image.Point
}

type ColorTable

type ColorTable struct {
	ColorText                  color.RGBA
	ColorWindow                color.RGBA
	ColorHeader                color.RGBA
	ColorBorder                color.RGBA
	ColorButton                color.RGBA
	ColorButtonHover           color.RGBA
	ColorButtonActive          color.RGBA
	ColorToggle                color.RGBA
	ColorToggleHover           color.RGBA
	ColorToggleCursor          color.RGBA
	ColorSelect                color.RGBA
	ColorSelectActive          color.RGBA
	ColorSlider                color.RGBA
	ColorSliderCursor          color.RGBA
	ColorSliderCursorHover     color.RGBA
	ColorSliderCursorActive    color.RGBA
	ColorProperty              color.RGBA
	ColorEdit                  color.RGBA
	ColorEditCursor            color.RGBA
	ColorCombo                 color.RGBA
	ColorChart                 color.RGBA
	ColorChartColor            color.RGBA
	ColorChartColorHighlight   color.RGBA
	ColorScrollbar             color.RGBA
	ColorScrollbarCursor       color.RGBA
	ColorScrollbarCursorHover  color.RGBA
	ColorScrollbarCursorActive color.RGBA
	ColorTabHeader             color.RGBA
}

type Combo

type Combo struct {
	Normal         Item
	Hover          Item
	Active         Item
	BorderColor    color.RGBA
	LabelNormal    color.RGBA
	LabelHover     color.RGBA
	LabelActive    color.RGBA
	SymbolNormal   color.RGBA
	SymbolHover    color.RGBA
	SymbolActive   color.RGBA
	Button         Button
	SymNormal      label.SymbolType
	SymHover       label.SymbolType
	SymActive      label.SymbolType
	Border         int
	Rounding       uint16
	ContentPadding image.Point
	ButtonPadding  image.Point
	Spacing        image.Point
}

type Edit

type Edit struct {
	Normal             Item
	Hover              Item
	Active             Item
	BorderColor        color.RGBA
	Scrollbar          Scrollbar
	CursorNormal       color.RGBA
	CursorHover        color.RGBA
	CursorTextNormal   color.RGBA
	CursorTextHover    color.RGBA
	TextNormal         color.RGBA
	TextHover          color.RGBA
	TextActive         color.RGBA
	SelectedNormal     color.RGBA
	SelectedHover      color.RGBA
	SelectedTextNormal color.RGBA
	SelectedTextHover  color.RGBA
	Border             int
	Rounding           uint16
	ScrollbarSize      image.Point
	Padding            image.Point
	RowPadding         int
}

type HeaderAlign

type HeaderAlign int
const (
	HeaderLeft HeaderAlign = iota
	HeaderRight
)

type Item

type Item struct {
	Type ItemType
	Data ItemData
}

func ItemHide

func ItemHide() Item

func MakeItemColor

func MakeItemColor(col color.RGBA) Item

func MakeItemImage

func MakeItemImage(img *image.RGBA) Item

type ItemData

type ItemData struct {
	Image *image.RGBA
	Color color.RGBA
}

type ItemType

type ItemType int
const (
	ItemColor ItemType = iota
	ItemImage
)

type Progress

type Progress struct {
	Normal       Item
	Hover        Item
	Active       Item
	CursorNormal Item
	CursorHover  Item
	CursorActive Item
	Rounding     uint16
	Padding      image.Point
	DrawBegin    func(*command.Buffer)
	Draw         func(*command.Buffer, WidgetStates, *Progress, image.Rectangle, image.Rectangle, int, int)
	DrawEnd      func(*command.Buffer)
}

type Property

type Property struct {
	Normal      Item
	Hover       Item
	Active      Item
	BorderColor color.RGBA
	LabelNormal color.RGBA
	LabelHover  color.RGBA
	LabelActive color.RGBA
	SymLeft     label.SymbolType
	SymRight    label.SymbolType
	Border      int
	Rounding    uint16
	Padding     image.Point
	Edit        Edit
	IncButton   Button
	DecButton   Button
	DrawBegin   func(*command.Buffer)
	Draw        func(*command.Buffer, *Property, image.Rectangle, image.Rectangle, WidgetStates, string, font.Face)
	DrawEnd     func(*command.Buffer)
}

type Scrollbar

type Scrollbar struct {
	Normal       Item
	Hover        Item
	Active       Item
	BorderColor  color.RGBA
	CursorNormal Item
	CursorHover  Item
	CursorActive Item
	Border       int
	Rounding     uint16
	Padding      image.Point
	ShowButtons  bool
	IncButton    Button
	DecButton    Button
	IncSymbol    label.SymbolType
	DecSymbol    label.SymbolType
	DrawBegin    func(*command.Buffer)
	Draw         func(*command.Buffer, WidgetStates, *Scrollbar, image.Rectangle, image.Rectangle)
	DrawEnd      func(*command.Buffer)
}

type Selectable

type Selectable struct {
	Normal            Item
	Hover             Item
	Pressed           Item
	NormalActive      Item
	HoverActive       Item
	PressedActive     Item
	TextNormal        color.RGBA
	TextHover         color.RGBA
	TextPressed       color.RGBA
	TextNormalActive  color.RGBA
	TextHoverActive   color.RGBA
	TextPressedActive color.RGBA
	TextBackground    color.RGBA
	TextAlignment     uint32
	Rounding          uint16
	Padding           image.Point
	TouchPadding      image.Point
	DrawBegin         func(*command.Buffer)
	Draw              func(*command.Buffer, WidgetStates, *Selectable, bool, image.Rectangle, string, label.Align, font.Face)
	DrawEnd           func(*command.Buffer)
}

type Slider

type Slider struct {
	Normal       Item
	Hover        Item
	Active       Item
	BorderColor  color.RGBA
	BarNormal    color.RGBA
	BarHover     color.RGBA
	BarActive    color.RGBA
	BarFilled    color.RGBA
	CursorNormal Item
	CursorHover  Item
	CursorActive Item
	Border       int
	Rounding     uint16
	BarHeight    int
	Padding      image.Point
	Spacing      image.Point
	CursorSize   image.Point
	ShowButtons  bool
	IncButton    Button
	DecButton    Button
	IncSymbol    label.SymbolType
	DecSymbol    label.SymbolType
	DrawBegin    func(*command.Buffer)
	Draw         func(*command.Buffer, WidgetStates, *Slider, image.Rectangle, image.Rectangle, float64, float64, float64)
	DrawEnd      func(*command.Buffer)
}

type Style

type Style struct {
	Scaling float64

	Font             font.Face
	Text             Text
	Button           Button
	ContextualButton Button
	MenuButton       Button
	Option           Toggle
	Checkbox         Toggle
	Selectable       Selectable
	Slider           Slider
	Progress         Progress
	Property         Property
	Edit             Edit
	Scrollh          Scrollbar
	Scrollv          Scrollbar
	Tab              Tab
	Combo            Combo
	NormalWindow     Window
	MenuWindow       Window
	TooltipWindow    Window
	ComboWindow      Window
	ContextualWindow Window
	GroupWindow      Window
	// contains filtered or unexported fields
}

func FromTable

func FromTable(table ColorTable, scaling float64) *Style

func FromTheme

func FromTheme(theme Theme, scaling float64) *Style

func (*Style) DefaultFont

func (style *Style) DefaultFont(scaling float64)

func (*Style) Defaults

func (style *Style) Defaults()

func (*Style) Scale

func (style *Style) Scale(scaling float64)

type Tab

type Tab struct {
	Background  Item
	BorderColor color.RGBA
	Text        color.RGBA
	TabButton   Button
	NodeButton  Button
	SymMinimize label.SymbolType
	SymMaximize label.SymbolType
	Border      int
	Rounding    uint16
	Padding     image.Point
	Spacing     image.Point
	Indent      int
}

type Text

type Text struct {
	Color   color.RGBA
	Padding image.Point
}

type Theme

type Theme int
const (
	DefaultTheme Theme = iota
	WhiteTheme
	RedTheme
	DarkTheme
)

type Toggle

type Toggle struct {
	Normal         Item
	Hover          Item
	Active         Item
	CursorNormal   Item
	CursorHover    Item
	TextNormal     color.RGBA
	TextHover      color.RGBA
	TextActive     color.RGBA
	TextBackground color.RGBA
	Padding        image.Point
	TouchPadding   image.Point
	DrawBegin      func(*command.Buffer)
	Draw           CustomToggleDrawing
	DrawEnd        func(*command.Buffer)
}

type WidgetStates

type WidgetStates int
const (
	WidgetStateInactive WidgetStates = iota
	WidgetStateHovered
	WidgetStateActive
)

type Window

type Window struct {
	Header          WindowHeader
	FixedBackground Item
	Background      color.RGBA
	BorderColor     color.RGBA
	Scaler          Item
	FooterPadding   image.Point
	Border          int
	Rounding        uint16
	ScalerSize      image.Point
	Padding         image.Point
	Spacing         image.Point
	ScrollbarSize   image.Point
	MinSize         image.Point
}

type WindowHeader

type WindowHeader struct {
	Normal         Item
	Hover          Item
	Active         Item
	CloseButton    Button
	MinimizeButton Button
	CloseSymbol    label.SymbolType
	MinimizeSymbol label.SymbolType
	MaximizeSymbol label.SymbolType
	LabelNormal    color.RGBA
	LabelHover     color.RGBA
	LabelActive    color.RGBA
	Align          HeaderAlign
	Padding        image.Point
	LabelPadding   image.Point
	Spacing        image.Point
}

Jump to

Keyboard shortcuts

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