layout

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	MinSize    Point
	MaxSize    Point
	ChildIds   []matcha.Id
	LayoutFunc func(matcha.Id, Point, Point) Guide
}

func (*Context) LayoutChild

func (l *Context) LayoutChild(id matcha.Id, minSize, maxSize Point) Guide

type Guide

type Guide struct {
	Frame Rect
	// Insets Insets
	ZIndex int
}

func (Guide) Bottom

func (g Guide) Bottom() float64

func (Guide) CenterX

func (g Guide) CenterX() float64

func (Guide) CenterY

func (g Guide) CenterY() float64

func (Guide) Fit

func (g Guide) Fit(ctx *Context) Guide

Fit adjusts the frame of the guide to be within MinSize and MaxSize of the LayoutContext.

func (Guide) Height

func (g Guide) Height() float64

func (Guide) Left

func (g Guide) Left() float64

func (Guide) MarshalProtobuf

func (g Guide) MarshalProtobuf() *pb.Guide

func (Guide) Right

func (g Guide) Right() float64

func (Guide) Top

func (g Guide) Top() float64

func (Guide) Width

func (g Guide) Width() float64

type Insets

type Insets struct {
	Top    float64
	Left   float64
	Bottom float64
	Right  float64
}

func In

func In(top, left, bottom, right float64) Insets

func (*Insets) MarshalProtobuf

func (in *Insets) MarshalProtobuf() *pb.Insets

type Layouter

type Layouter interface {
	Layout(ctx *Context) (Guide, map[matcha.Id]Guide)
	comm.Notifier
}

type Point

type Point struct {
	X float64
	Y float64
}

func Pt

func Pt(x, y float64) Point

func (*Point) MarshalProtobuf

func (p *Point) MarshalProtobuf() *pb.Point

func (*Point) UnmarshalProtobuf

func (p *Point) UnmarshalProtobuf(pbpoint *pb.Point)

type PointNotifier

type PointNotifier interface {
	comm.Notifier
	Value() Point
}

type Rect

type Rect struct {
	Min, Max Point
}

func Rt

func Rt(x0, y0, x1, y1 float64) Rect

func (Rect) Add

func (r Rect) Add(p Point) Rect

func (*Rect) MarshalProtobuf

func (r *Rect) MarshalProtobuf() *pb.Rect

func (Rect) String

func (r Rect) String() string

func (*Rect) UnmarshalProtobuf

func (r *Rect) UnmarshalProtobuf(pbrect *pb.Rect)

Directories

Path Synopsis
Package absolute implements a fixed layout system similar to HTML absolute positioning.
Package absolute implements a fixed layout system similar to HTML absolute positioning.
Package constraint implements a constraint-based layout system.
Package constraint implements a constraint-based layout system.
Package full implements a layout system where the view and all direct children are positioned to the maximum size.
Package full implements a layout system where the view and all direct children are positioned to the maximum size.
Package table implements a vertical, single column layout system.
Package table implements a vertical, single column layout system.

Jump to

Keyboard shortcuts

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