fynex

package
v0.0.0-...-c1607c5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// IconSize used with (in display pixels) used with Material Design elements
	IconSize = 24

	// Padding (in display pixels) used with Material Design elements
	Padding = 16
)

Functions

func NewScaledText

func NewScaledText(level TextSize, text string) *canvas.Text

NewScaledText returns a canvas.Text element with a given Material Design type scale applied to it.

func NewTextWithStyle

func NewTextWithStyle(text string, alignment fyne.TextAlign, style Style) *canvas.Text

NewTextWithStyle returns a canvas.Text element with a given alignment and Material Design Style applied to it. Mimics widget.NewLabelWithStyle

Types

type AppBar

type AppBar struct {
	widget.BaseWidget

	Dense     bool
	Extended  bool
	NavClosed bool
	// contains filtered or unexported fields
}

AppBar ...

func NewAppBar

func NewAppBar(title string) *AppBar

NewAppBar ...

func (*AppBar) CreateRenderer

func (bar *AppBar) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new WidgetRenderer for this widget. This should not be called by regular code, it is used internally to render a widget.

Implements: fyne.Widget

func (*AppBar) SetDense

func (bar *AppBar) SetDense(dense bool)

SetDense ...

func (*AppBar) SetExtended

func (bar *AppBar) SetExtended(extended bool)

SetExtended ...

func (*AppBar) SetNav

func (bar *AppBar) SetNav(nav *NavDrawer)

SetNav ...

func (*AppBar) SetNavClosed

func (bar *AppBar) SetNavClosed(closed bool)

SetNavClosed ...

func (*AppBar) SetTitle

func (bar *AppBar) SetTitle(title string)

SetTitle ...

type NavDrawer struct {
	widget.BaseWidget

	OnDeselect func(NavItem) bool
	OnSelect   func(NavItem)
	// contains filtered or unexported fields
}

NavDrawer ...

func NewNavDrawer

func NewNavDrawer(title, subtitle string, items ...NavItem) *NavDrawer

NewNavDrawer ...

func (nav *NavDrawer) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new WidgetRenderer for this widget. This should not be called by regular code, it is used internally to render a widget.

Implements: fyne.Widget

func (nav *NavDrawer) Select(id int)

Select ...

func (nav *NavDrawer) SetImage(image fyne.Resource)

SetImage ...

func (nav *NavDrawer) SetSubtitle(subtitle string)

SetSubtitle ...

func (nav *NavDrawer) SetTitle(title string)

SetTitle ...

type NavItem interface {
	GetContent() fyne.CanvasObject
	GetLabel() fyne.CanvasObject
	// GetIcon() fyne.Resource
	GetTitle() string
}

NavItem ...

func NewNavLabel

func NewNavLabel(label string, content fyne.CanvasObject) NavItem

NewNavLabel ...

func NewNavLabelWithIcon

func NewNavLabelWithIcon(label string, icon fyne.Resource, content fyne.CanvasObject) NavItem

NewNavLabelWithIcon ...

func NewNavSeparator

func NewNavSeparator() NavItem

NewNavSeparator returns a new NavDrawer divider

type NavLabel struct {
	// contains filtered or unexported fields
}

NavLabel ...

func (l *NavLabel) GetContent() fyne.CanvasObject

GetContent ...

func (l *NavLabel) GetLabel() fyne.CanvasObject

GetLabel ...

func (l *NavLabel) GetTitle() string

GetTitle ...

type NavSeparator struct {
	// contains filtered or unexported fields
}

NavSeparator represents a visual dividing line to be shown between other NavItem(s) within a NavDrawer -- it should not receive focus or be a candidate for selection because it contains no content.

func (*NavSeparator) GetContent() fyne.CanvasObject

GetContent ...

func (l *NavSeparator) GetLabel() fyne.CanvasObject

GetLabel ...

func (*NavSeparator) GetTitle() string

GetTitle ...

type Pane

type Pane interface {
	GetWindow() gui.Window

	GetContent() fyne.CanvasObject
	SetContent(fyne.CanvasObject)
	GetLabel() fyne.CanvasObject
	// GetIcon() fyne.Resource
	SetIcon(fyne.Resource)
	GetTitle() string
	SetTitle(string)
}

Pane ...

Implements: NavigationItem

func NewPane

func NewPane(title string, window gui.Window) Pane

NewPane returns a pane to be used with navigation, specifying a title

func NewPaneWithIcon

func NewPaneWithIcon(title string, icon fyne.Resource, window gui.Window) Pane

NewPaneWithIcon returns a pane to be used with navigation, specifying title and icon

type PaneBase

type PaneBase struct {
	// contains filtered or unexported fields
}

PaneBase ...

Implements: Pane

func (*PaneBase) GetContent

func (p *PaneBase) GetContent() fyne.CanvasObject

GetContent returns the content of this pane

func (*PaneBase) GetLabel

func (p *PaneBase) GetLabel() fyne.CanvasObject

GetLabel returns the assemebled label element for this pane

func (*PaneBase) GetTitle

func (p *PaneBase) GetTitle() string

GetTitle returns the text shown in labels associated with this pane

func (*PaneBase) GetWindow

func (p *PaneBase) GetWindow() gui.Window

GetWindow returns the parent window this pane is shown in

func (*PaneBase) SetContent

func (p *PaneBase) SetContent(content fyne.CanvasObject)

SetContent changes the element to be shown when this pane is selected

func (*PaneBase) SetIcon

func (p *PaneBase) SetIcon(icon fyne.Resource)

SetIcon changes the icon shown in labels associated with this pane

func (*PaneBase) SetTitle

func (p *PaneBase) SetTitle(title string)

SetTitle changes the text shown in labels associated with this pane

type Style

type Style struct {
	Size TextSize
	fyne.TextStyle
}

Style is a wrapped fyne.TextStyle with a TextSize

func StyleHeading5

func StyleHeading5() Style

StyleHeading5 is the Material Design standard Heading5 text style

type TextSize

type TextSize uint8

TextSize refers to a Typgraphical Sizing defined by Material Design

const (
	// TextSizeBody1 is 16dp and represents regular body type
	TextSizeBody1 TextSize = iota

	// TextSizeBody2 is 14dp and represents condensed body type
	TextSizeBody2

	// TextSizeSubtitle1 is 16dp and represents a medium subtitle
	TextSizeSubtitle1

	// TextSizeSubtitle2 is 14dp and represents a light subtitle
	TextSizeSubtitle2

	// TextSizeHeading1 is 96dp and represents hero type
	TextSizeHeading1

	// TextSizeHeading2 is 60dp and represents a primary heading
	TextSizeHeading2

	// TextSizeHeading3 is 48dp and represents a secondary heading
	TextSizeHeading3

	// TextSizeHeading4 is 34dp
	TextSizeHeading4

	// TextSizeHeading5 is 24dp
	TextSizeHeading5

	// TextSizeHeading6 is 20dp and used by component Titles
	TextSizeHeading6
)

Jump to

Keyboard shortcuts

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