paint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package paint implements view display properties.

func (v *View) Build(ctx *view.Context) view.Model {
	return view.Model{
		Painter: &paint.Style{
			BackgroundColor: colornames.Green,
			CornerRadius: 3,
		},
	}
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnimatedStyle

type AnimatedStyle struct {
	Style           Style
	Transparency    comm.Float64Notifier
	BackgroundColor comm.ColorNotifier
	BorderColor     comm.ColorNotifier
	BorderWidth     comm.Float64Notifier
	CornerRadius    comm.Float64Notifier
	ShadowRadius    comm.Float64Notifier
	ShadowOffset    layout.PointNotifier
	ShadowColor     comm.ColorNotifier
	// contains filtered or unexported fields
}

AnimatedStyle is the animated version of Style.

func (*AnimatedStyle) Notify

func (as *AnimatedStyle) Notify(f func()) comm.Id

Notify implements the Painter interface.

func (*AnimatedStyle) PaintStyle

func (as *AnimatedStyle) PaintStyle() Style

PaintStyle implements the Painter interface.

func (*AnimatedStyle) Unnotify

func (as *AnimatedStyle) Unnotify(id comm.Id)

Unnotify implements the Painter interface.

type Painter

type Painter interface {
	PaintStyle() Style
	comm.Notifier
}

Painter is the interface that describes how a view should be drawn on screen.

type Style

type Style struct {
	Transparency    float64
	BackgroundColor color.Color
	BorderColor     color.Color
	BorderWidth     float64
	CornerRadius    float64
	ShadowRadius    float64
	ShadowOffset    layout.Point
	ShadowColor     color.Color
}

Style is a list of display properties of that views can set.

func (*Style) MarshalProtobuf

func (s *Style) MarshalProtobuf() *paint.Style

func (*Style) Notify

func (s *Style) Notify(func()) comm.Id

Notify implements the Painter interface. This is a no-op.

func (*Style) PaintStyle

func (s *Style) PaintStyle() Style

PaintStyle implements the Painter interface.

func (*Style) Unnotify

func (s *Style) Unnotify(id comm.Id)

Unnotify implements the Painter interface. This is a no-op.

Jump to

Keyboard shortcuts

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