inkwell

package
v0.0.0-...-955f326 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InkWell

type InkWell struct {
	ux.Panel

	ImageFromURLCallback  func(urlStr string, scale float64) (*draw.Image, error)
	InkChangedCallback    func()
	ClickCallback         func()
	ValidateImageCallback func(*draw.Image) *draw.Image

	Pressed bool
	// contains filtered or unexported fields
}

InkWell represents a control that holds and lets a user choose an ink.

func New

func New() *InkWell

New creates a new InkWell.

func (*InkWell) AllowedTypes

func (well *InkWell) AllowedTypes() Mask

AllowedTypes returns the types of ink allowed to be set via SetInk().

func (*InkWell) BackgroundInk

func (well *InkWell) BackgroundInk() draw.Ink

BackgroundInk returns the ink that will be used for the background when enabled but not pressed or focused.

func (*InkWell) Click

func (well *InkWell) Click()

Click makes the ink well behave as if a user clicked on it.

func (*InkWell) ClickAnimationTime

func (well *InkWell) ClickAnimationTime() time.Duration

ClickAnimationTime returns the amount of time to spend animating the click action.

func (*InkWell) ContentSize

func (well *InkWell) ContentSize() float64

ContentSize returns the content width and height.

func (*InkWell) CornerRadius

func (well *InkWell) CornerRadius() float64

CornerRadius returns the amount of rounding to use on the corners.

func (*InkWell) DefaultClick

func (well *InkWell) DefaultClick()

DefaultClick provides the default click handling, which shows a dialog for selecting an ink.

func (*InkWell) DefaultDragEntered

func (well *InkWell) DefaultDragEntered(dragInfo *ux.DragInfo) ux.DragOperation

DefaultDragEntered provides the default drag entered behavior.

func (*InkWell) DefaultDragExited

func (well *InkWell) DefaultDragExited()

DefaultDragExited provides the default drag exited behavior.

func (*InkWell) DefaultDragUpdated

func (well *InkWell) DefaultDragUpdated(dragInfo *ux.DragInfo) ux.DragOperation

DefaultDragUpdated provides the default drag updated behavior.

func (*InkWell) DefaultDraw

func (well *InkWell) DefaultDraw(gc draw.Context, dirty geom.Rect, inLiveResize bool)

DefaultDraw provides the default drawing.

func (*InkWell) DefaultDrop

func (well *InkWell) DefaultDrop(dragInfo *ux.DragInfo) bool

DefaultDrop provides the default drop behavior.

func (*InkWell) DefaultDropFinished

func (well *InkWell) DefaultDropFinished(dragInfo *ux.DragInfo)

DefaultDropFinished provides the default drop finished behavior.

func (*InkWell) DefaultImageFromURL

func (well *InkWell) DefaultImageFromURL(urlStr string, scale float64) (*draw.Image, error)

DefaultImageFromURL provides the default ImageFromURL behavior.

func (*InkWell) DefaultIsDropAcceptable

func (well *InkWell) DefaultIsDropAcceptable(dragInfo *ux.DragInfo) bool

DefaultIsDropAcceptable provides the default is drop acceptable behavior.

func (*InkWell) DefaultKeyDown

func (well *InkWell) DefaultKeyDown(keyCode int, ch rune, mod keys.Modifiers, repeat bool) bool

DefaultKeyDown provides the default key down handling.

func (*InkWell) DefaultMouseDown

func (well *InkWell) DefaultMouseDown(where geom.Point, button, clickCount int, mod keys.Modifiers) bool

DefaultMouseDown provides the default mouse down handling.

func (*InkWell) DefaultMouseDrag

func (well *InkWell) DefaultMouseDrag(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseDrag provides the default mouse drag handling.

func (*InkWell) DefaultMouseUp

func (well *InkWell) DefaultMouseUp(where geom.Point, button int, mod keys.Modifiers)

DefaultMouseUp provides the default mouse up handling.

func (*InkWell) DefaultSizes

func (well *InkWell) DefaultSizes(hint geom.Size) (min, pref, max geom.Size)

DefaultSizes provides the default sizing.

func (*InkWell) EdgeHighlightInk

func (well *InkWell) EdgeHighlightInk() draw.Ink

EdgeHighlightInk returns the ink that will be used just inside the edges.

func (*InkWell) EdgeInk

func (well *InkWell) EdgeInk() draw.Ink

EdgeInk returns the ink that will be used for the edges.

func (*InkWell) FocusedBackgroundInk

func (well *InkWell) FocusedBackgroundInk() draw.Ink

FocusedBackgroundInk returns the ink that will be used for the background when enabled and focused.

func (*InkWell) ImageScale

func (well *InkWell) ImageScale() float64

ImageScale returns the image scale to use for images dropped onto the well. Defaults to 0.5 to support retina displays.

func (*InkWell) Ink

func (well *InkWell) Ink() draw.Ink

Ink returns the well's ink.

func (*InkWell) PressedBackgroundInk

func (well *InkWell) PressedBackgroundInk() draw.Ink

PressedBackgroundInk returns the ink that will be used for the background when enabled and pressed.

func (*InkWell) SetAllowedTypes

func (well *InkWell) SetAllowedTypes(mask Mask) *InkWell

SetAllowedTypes sets the types of ink allowed to be set via SetInk().

func (*InkWell) SetBackgroundInk

func (well *InkWell) SetBackgroundInk(value draw.Ink) *InkWell

SetBackgroundInk sets the ink that will be used for the background when enabled but not pressed or focused. Pass in nil to use the default.

func (*InkWell) SetBorder

func (well *InkWell) SetBorder(value border.Border) *InkWell

SetBorder sets the border. May be nil.

func (*InkWell) SetClickAnimationTime

func (well *InkWell) SetClickAnimationTime(value time.Duration) *InkWell

SetClickAnimationTime sets the amount of time to spend animating the click action.

func (*InkWell) SetContentSize

func (well *InkWell) SetContentSize(value float64) *InkWell

SetContentSize sets the content width and height.

func (*InkWell) SetCornerRadius

func (well *InkWell) SetCornerRadius(value float64) *InkWell

SetCornerRadius sets the amount of rounding to use on the corners.

func (*InkWell) SetEdgeHighlightInk

func (well *InkWell) SetEdgeHighlightInk(value draw.Ink) *InkWell

SetEdgeHighlightInk sets the ink that will be used just inside the edges. Pass in nil to use the default.

func (*InkWell) SetEdgeInk

func (well *InkWell) SetEdgeInk(value draw.Ink) *InkWell

SetEdgeInk sets the ink that will be used for the edges. Pass in nil to use the default.

func (*InkWell) SetEnabled

func (well *InkWell) SetEnabled(enabled bool) *InkWell

SetEnabled sets enabled state.

func (*InkWell) SetFocusable

func (well *InkWell) SetFocusable(focusable bool) *InkWell

SetFocusable whether it can have the keyboard focus.

func (*InkWell) SetFocusedBackgroundInk

func (well *InkWell) SetFocusedBackgroundInk(value draw.Ink) *InkWell

SetFocusedBackgroundInk sets the ink that will be used for the background when enabled and focused. Pass in nil to use the default.

func (*InkWell) SetImageScale

func (well *InkWell) SetImageScale(value float64) *InkWell

SetImageScale sets the image scale to use for images dropped onto the well. Defaults to 0.5 to support retina displays.

func (*InkWell) SetInk

func (well *InkWell) SetInk(ink draw.Ink) *InkWell

SetInk sets the ink well's ink.

func (*InkWell) SetPressedBackgroundInk

func (well *InkWell) SetPressedBackgroundInk(value draw.Ink) *InkWell

SetPressedBackgroundInk sets the ink that will be used for the background when enabled and pressed. Pass in nil to use the default.

type Mask

type Mask uint8

Mask is used to limit the types of ink permitted in the ink well.

const (
	ColorInkWellMask Mask = 1 << iota
	PatternInkWellMask
	GradientInkWellMask
)

Possible ink well masks.

Jump to

Keyboard shortcuts

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