Documentation
¶
Index ¶
- func HideWidget(b *Base, w fyne.Widget)
- func MinSizeOf(w fyne.Widget) fyne.Size
- func MoveWidget(b *Base, w fyne.Widget, pos fyne.Position)
- func RefreshWidget(w fyne.Widget)
- func ResizeWidget(b *Base, w fyne.Widget, size fyne.Size)
- func ShowWidget(b *Base, w fyne.Widget)
- type Base
- type BaseRenderer
- type ElevationLevel
- type OverlayContainer
- func (o *OverlayContainer) CreateRenderer() fyne.WidgetRenderer
- func (o *OverlayContainer) Hide()
- func (o *OverlayContainer) MinSize() fyne.Size
- func (o *OverlayContainer) MouseIn(*desktop.MouseEvent)
- func (o *OverlayContainer) MouseMoved(*desktop.MouseEvent)
- func (o *OverlayContainer) MouseOut()
- func (o *OverlayContainer) Move(pos fyne.Position)
- func (o *OverlayContainer) Refresh()
- func (o *OverlayContainer) Resize(size fyne.Size)
- func (o *OverlayContainer) Show()
- func (o *OverlayContainer) Tapped(*fyne.PointEvent)
- type Shadow
- type ShadowType
- type ShadowingRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HideWidget ¶
HideWidget is a helper method to hide and refresh a widget.
func MoveWidget ¶
MoveWidget is a helper method to set the position of a widget relative to its parent.
func RefreshWidget ¶
RefreshWidget is a helper method to refresh a widget.
func ResizeWidget ¶
ResizeWidget is a helper method to resize a widget.
func ShowWidget ¶
ShowWidget is a helper method to show and refresh a widget.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is a simple base widget for internal use.
func (*Base) Position ¶
Position returns the position of the widget relative to its parent.
Implements: fyne.Widget
type BaseRenderer ¶
type BaseRenderer struct {
// contains filtered or unexported fields
}
BaseRenderer is a renderer base providing the most common implementations of a part of the widget.Renderer interface.
func NewBaseRenderer ¶
func NewBaseRenderer(objects []fyne.CanvasObject) BaseRenderer
NewBaseRenderer creates a new BaseRenderer.
func (*BaseRenderer) BackgroundColor ¶
func (r *BaseRenderer) BackgroundColor() color.Color
BackgroundColor returns the theme background color.
Implements: fyne.WidgetRenderer
func (*BaseRenderer) Destroy ¶
func (r *BaseRenderer) Destroy()
Destroy does nothing in the base implementation.
Implements: fyne.WidgetRenderer
func (*BaseRenderer) Objects ¶
func (r *BaseRenderer) Objects() []fyne.CanvasObject
Objects returns the objects that should be rendered.
Implements: fyne.WidgetRenderer
func (*BaseRenderer) SetObjects ¶
func (r *BaseRenderer) SetObjects(objects []fyne.CanvasObject)
SetObjects updates the objects of the renderer.
type ElevationLevel ¶
type ElevationLevel int
ElevationLevel is the level of elevation of the shadow casting object.
const ( BaseLevel ElevationLevel = 0 CardLevel ElevationLevel = 1 ButtonLevel ElevationLevel = 2 MenuLevel ElevationLevel = 4 PopUpLevel ElevationLevel = 8 SubmergedContentLevel ElevationLevel = 8 DialogLevel ElevationLevel = 24 )
ElevationLevel constants inspired by: https://storage.googleapis.com/spec-host/mio-staging%2Fmio-design%2F1584058305895%2Fassets%2F0B6xUSjjSulxceF9udnA4Sk5tdU0%2Fbaselineelevation-chart.png
type OverlayContainer ¶
type OverlayContainer struct { Base Content fyne.CanvasObject // contains filtered or unexported fields }
OverlayContainer is a transparent widget containing one fyne.CanvasObject and meant to be used as overlay.
func NewOverlayContainer ¶
func NewOverlayContainer(c fyne.CanvasObject, canvas fyne.Canvas, onDismiss func()) *OverlayContainer
NewOverlayContainer creates an OverlayContainer.
func (*OverlayContainer) CreateRenderer ¶
func (o *OverlayContainer) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for the overlay container.
Implements: fyne.Widget
func (*OverlayContainer) Hide ¶
func (o *OverlayContainer) Hide()
Hide hides the overlay container.
Implements: fyne.Widget
func (*OverlayContainer) MinSize ¶
func (o *OverlayContainer) MinSize() fyne.Size
MinSize returns the minimal size of the overlay container. This is the same as the size of the canvas.
Implements: fyne.Widget
func (*OverlayContainer) MouseIn ¶
func (o *OverlayContainer) MouseIn(*desktop.MouseEvent)
MouseIn catches mouse-in events not handled by the container’s content. It does nothing.
Implements: desktop.Hoverable
func (*OverlayContainer) MouseMoved ¶
func (o *OverlayContainer) MouseMoved(*desktop.MouseEvent)
MouseMoved catches mouse-moved events not handled by the container’s content. It does nothing.
Implements: desktop.Hoverable
func (*OverlayContainer) MouseOut ¶
func (o *OverlayContainer) MouseOut()
MouseOut catches mouse-out events not handled by the container’s content. It does nothing.
Implements: desktop.Hoverable
func (*OverlayContainer) Move ¶
func (o *OverlayContainer) Move(pos fyne.Position)
Move sets the position of the widget relative to its parent.
Implements: fyne.Widget
func (*OverlayContainer) Refresh ¶
func (o *OverlayContainer) Refresh()
Refresh triggers a redraw of the overlay container.
Implements: fyne.Widget
func (*OverlayContainer) Resize ¶
func (o *OverlayContainer) Resize(size fyne.Size)
Resize changes the size of the overlay container. This is normally called by the canvas overlay management.
Implements: fyne.Widget
func (*OverlayContainer) Show ¶
func (o *OverlayContainer) Show()
Show makes the overlay container visible.
Implements: fyne.Widget
func (*OverlayContainer) Tapped ¶
func (o *OverlayContainer) Tapped(*fyne.PointEvent)
Tapped catches tap events not handled by the container’s content. It performs the overlay container’s dismiss action.
Implements: fyne.Tappable
type Shadow ¶
type Shadow struct { Base // contains filtered or unexported fields }
Shadow is a widget that renders a shadow.
func NewShadow ¶
func NewShadow(typ ShadowType, level ElevationLevel) *Shadow
NewShadow create a new Shadow.
func (*Shadow) CreateRenderer ¶
func (s *Shadow) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns a new renderer for the shadow.
Implements: fyne.Widget
func (*Shadow) Move ¶
Move sets the position of the widget relative to its parent.
Implements: fyne.Widget
func (*Shadow) Refresh ¶
func (s *Shadow) Refresh()
Refresh triggers a redraw of the shadow.
Implements: fyne.Widget
type ShadowType ¶
type ShadowType int
ShadowType specifies the type of the shadow.
const ( ShadowAround ShadowType = iota ShadowLeft ShadowRight ShadowBottom ShadowTop )
ShadowType constants
type ShadowingRenderer ¶
type ShadowingRenderer struct { BaseRenderer // contains filtered or unexported fields }
ShadowingRenderer is a renderer that adds a shadow arount the rendered content. When using the ShadowingRenderer the embedding renderer should call LayoutShadow(contentSize, contentPos) to lay out the shadow.
func NewShadowingRenderer ¶
func NewShadowingRenderer(objects []fyne.CanvasObject, level ElevationLevel) *ShadowingRenderer
NewShadowingRenderer creates a ShadowingRenderer.
func (*ShadowingRenderer) LayoutShadow ¶
func (r *ShadowingRenderer) LayoutShadow(size fyne.Size, pos fyne.Position)
LayoutShadow adjusts the size and position of the shadow if necessary.
func (*ShadowingRenderer) SetObjects ¶
func (r *ShadowingRenderer) SetObjects(objects []fyne.CanvasObject)
SetObjects updates the renderer's objects including the shadow if necessary.