overlays

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// AnchorToRight can be provided as the X anchor to pin the tool overlay
	// to the right of the screen.
	AnchorToRight = 9001
	// AnchorToLeft can be provided as the X anchor to pin the tool overlay
	// to the left of the screen.
	AnchorToLeft = 1337
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

type Tool struct {
	Icon     *gdk.Pixbuf
	Drop     func(x, y float64)
	Selected func()
}

type ToolOverlay

type ToolOverlay struct {
	Tools []Tool
	// contains filtered or unexported fields
}

ToolOverlay implements a tool selection overlay.

func Toolbar

func Toolbar(selectable bool, tools []Tool) *ToolOverlay

Toolbar contructs a tool overlay from the given tools.

func ToolbarAtAnchor added in v0.4.11

func ToolbarAtAnchor(selectable bool, tools []Tool, xAnchor, yAnchor float64) *ToolOverlay

ToolbarAtAnchor contructs a tool overlay from the given tools, anchored at the specified X and Y ratios. If yAnchor is zero, the toolbar will be pinned to the top of the flowchart.

func (*ToolOverlay) Configure

func (o *ToolOverlay) Configure(w, h int)

Configure implements flowui.Overlay.

func (*ToolOverlay) Draw

func (o *ToolOverlay) Draw(da *gtk.DrawingArea, cr *cairo.Context)

Draw implements flowui.Overlay.

func (*ToolOverlay) GetBounds added in v0.4.11

func (o *ToolOverlay) GetBounds() (x1, y1, x2, y2 float64)

GetBounds returns the bounding box of the toolbar.

func (*ToolOverlay) HandleKeypress

func (o *ToolOverlay) HandleKeypress(keyEvent *gdk.EventKey) bool

HandleKeypress implements tab & numbering shortcuts for keypress events. The caller should invoke this function for key presses.

func (*ToolOverlay) HandleMotionEvent

func (o *ToolOverlay) HandleMotionEvent(evt *gdk.EventMotion) bool

HandleMotionEvent implements flowui.Overlay.

func (*ToolOverlay) HandlePressEvent

func (o *ToolOverlay) HandlePressEvent(event *gdk.Event, press bool) bool

HandlePressEvent implements flowui.Overlay.

func (*ToolOverlay) HandleScrollEvent added in v0.5.6

func (o *ToolOverlay) HandleScrollEvent(evt *gdk.EventScroll) bool

Jump to

Keyboard shortcuts

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