titlebar

package
v0.0.0-...-8b98763 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConstructor = Constructor{
	Color:  color.RGBA{128, 128, 128, 255},
	Height: 32,
	Layers: []int{},
	Buttons: []Button{
		ButtonMinimize,
		ButtonMaximize,
		ButtonClose,
	},
	ButtonWidth:          32,
	TitleFontSize:        17,
	TitleXOffset:         10,
	TitleTextColor:       color.RGBA{255, 255, 255, 255},
	DoubleClickThreshold: 200 * time.Millisecond,
}

Functions

This section is empty.

Types

type Button

type Button uint8
const (
	ButtonMinimize Button = iota
	ButtonMaximize Button = iota
	ButtonClose    Button = iota
)

Buttons to show on the title bar

type Constructor

type Constructor struct {
	Color          color.Color
	HighlightColor color.Color
	MouseDownColor color.Color
	Height         float64
	Layers         []int

	Title          string
	TitleFontSize  int
	TitleXOffset   int
	TitleTextColor color.Color

	Buttons              []Button
	ButtonWidth          float64
	DoubleClickThreshold time.Duration
}

type Option

type Option func(Constructor) Constructor

func WithButtonWidth

func WithButtonWidth(v float64) Option

func WithButtons

func WithButtons(v []Button) Option

func WithColor

func WithColor(v color.Color) Option

func WithDoubleClickThreshold

func WithDoubleClickThreshold(v time.Duration) Option

func WithHeight

func WithHeight(v float64) Option

func WithHighlightColor

func WithHighlightColor(v color.Color) Option

func WithLayers

func WithLayers(v []int) Option

func WithMouseDownColor

func WithMouseDownColor(v color.Color) Option

func WithTitle

func WithTitle(v string) Option

func WithTitleFontSize

func WithTitleFontSize(v int) Option

func WithTitleTextColor

func WithTitleTextColor(v color.Color) Option

func WithTitleXOffset

func WithTitleXOffset(v int) Option

type TitleBar

type TitleBar struct {

	// TODO: restore desktop position getter
	DesktopPosition floatgeom.Point2
	// contains filtered or unexported fields
}

func New

func New(ctx *scene.Context, opts ...Option) *TitleBar

New constructs a new TitleBar

Jump to

Keyboard shortcuts

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