Documentation ¶
Overview ¶
Package widget contains community extensions for Fyne widgets
Index ¶
- type AnimatedGif
- func (g *AnimatedGif) CreateRenderer() fyne.WidgetRenderer
- func (g *AnimatedGif) Load(u fyne.URI) error
- func (g *AnimatedGif) LoadResource(r fyne.Resource) error
- func (g *AnimatedGif) MinSize() fyne.Size
- func (g *AnimatedGif) SetMinSize(min fyne.Size)
- func (g *AnimatedGif) Start()
- func (g *AnimatedGif) Stop()
- type Calendar
- type CompletionEntry
- type FileTree
- type GridWrapdeprecated
- func (l *GridWrap) CreateRenderer() fyne.WidgetRenderer
- func (l *GridWrap) GetScrollOffset() float32
- func (l *GridWrap) MinSize() fyne.Size
- func (l *GridWrap) Resize(s fyne.Size)
- func (l *GridWrap) ScrollTo(id GridWrapItemID)
- func (l *GridWrap) ScrollToBottom()
- func (l *GridWrap) ScrollToOffset(offset float32)
- func (l *GridWrap) ScrollToTop()
- type GridWrapItemID
- type HexWidget
- func (h *HexWidget) CreateRenderer() fyne.WidgetRenderer
- func (h *HexWidget) Set(val uint)
- func (h *HexWidget) SetOffColor(c color.Color)
- func (h *HexWidget) SetOnColor(c color.Color)
- func (h *HexWidget) SetSize(s fyne.Size)
- func (h *HexWidget) SetSlant(s float32)
- func (h *HexWidget) UpdateSegments(segments uint8)
- type Map
- type MapOption
- type NumericalEntry
- type TwoStateToolbarAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnimatedGif ¶
type AnimatedGif struct { widget.BaseWidget // contains filtered or unexported fields }
AnimatedGif widget shows a Gif image with many frames.
func NewAnimatedGif ¶
func NewAnimatedGif(u fyne.URI) (*AnimatedGif, error)
NewAnimatedGif creates a new widget loaded to show the specified image. If there is an error loading the image it will be returned in the error value.
func NewAnimatedGifFromResource ¶
func NewAnimatedGifFromResource(r fyne.Resource) (*AnimatedGif, error)
NewAnimatedGifFromResource creates a new widget loaded to show the specified image resource. If there is an error loading the image it will be returned in the error value.
func (*AnimatedGif) CreateRenderer ¶
func (g *AnimatedGif) CreateRenderer() fyne.WidgetRenderer
CreateRenderer loads the widget renderer for this widget. This is an internal requirement for Fyne.
func (*AnimatedGif) Load ¶
func (g *AnimatedGif) Load(u fyne.URI) error
Load is used to change the gif file shown. It will change the loaded content and prepare the new frames for animation.
func (*AnimatedGif) LoadResource ¶
func (g *AnimatedGif) LoadResource(r fyne.Resource) error
LoadResource is used to change the gif resource shown. It will change the loaded content and prepare the new frames for animation.
func (*AnimatedGif) MinSize ¶
func (g *AnimatedGif) MinSize() fyne.Size
MinSize returns the minimum size that this GIF can occupy. Because gif images are measured in pixels we cannot use the dimensions, so this defaults to 0x0. You can set a minimum size if required using SetMinSize.
func (*AnimatedGif) SetMinSize ¶
func (g *AnimatedGif) SetMinSize(min fyne.Size)
SetMinSize sets the smallest possible size that this AnimatedGif should be drawn at. Be careful not to set this based on pixel sizes as that will vary based on output device.
func (*AnimatedGif) Start ¶
func (g *AnimatedGif) Start()
Start begins the animation. The speed of the transition is controlled by the loaded gif file.
func (*AnimatedGif) Stop ¶
func (g *AnimatedGif) Stop()
Stop will request that the animation stops running, the last frame will remain visible
type Calendar ¶
type Calendar struct { widget.BaseWidget // contains filtered or unexported fields }
Calendar creates a new date time picker which returns a time object
func NewCalendar ¶
NewCalendar creates a calendar instance
func (*Calendar) CreateRenderer ¶
func (c *Calendar) 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.
type CompletionEntry ¶
type CompletionEntry struct { widget.Entry Options []string CustomCreate func() fyne.CanvasObject CustomUpdate func(id widget.ListItemID, object fyne.CanvasObject) // contains filtered or unexported fields }
CompletionEntry is an Entry with options displayed in a PopUpMenu.
func NewCompletionEntry ¶
func NewCompletionEntry(options []string) *CompletionEntry
NewCompletionEntry creates a new CompletionEntry which creates a popup menu that responds to keystrokes to navigate through the items without losing the editing ability of the text input.
func (*CompletionEntry) HideCompletion ¶
func (c *CompletionEntry) HideCompletion()
HideCompletion hides the completion menu.
func (*CompletionEntry) Move ¶
func (c *CompletionEntry) Move(pos fyne.Position)
Move changes the relative position of the select entry.
Implements: fyne.Widget
func (*CompletionEntry) Refresh ¶
func (c *CompletionEntry) Refresh()
Refresh the list to update the options to display.
func (*CompletionEntry) Resize ¶
func (c *CompletionEntry) Resize(size fyne.Size)
Resize sets a new size for a widget. Note this should not be used if the widget is being managed by a Layout within a Container.
func (*CompletionEntry) SetOptions ¶
func (c *CompletionEntry) SetOptions(itemList []string)
SetOptions set the completion list with itemList and update the view.
func (*CompletionEntry) ShowCompletion ¶
func (c *CompletionEntry) ShowCompletion()
ShowCompletion displays the completion menu
type FileTree ¶
type FileTree struct { widget.Tree Filter storage.FileFilter ShowRootPath bool Sorter func(fyne.URI, fyne.URI) bool // contains filtered or unexported fields }
FileTree extends widget.Tree to display a file system hierarchy.
func NewFileTree ¶
func NewFileTree(root fyne.URI) *FileTree
NewFileTree creates a new FileTree from the given root URI.
type GridWrap
deprecated
type GridWrap struct { widget.BaseWidget Length func() int `json:"-"` CreateItem func() fyne.CanvasObject `json:"-"` UpdateItem func(id GridWrapItemID, item fyne.CanvasObject) `json:"-"` // contains filtered or unexported fields }
GridWrap is a widget with an API very similar to widget.List, that lays out items in a scrollable wrapping grid similar to container.NewGridWrap. It caches and reuses widgets for performance.
Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
func NewGridWrap
deprecated
func NewGridWrap(length func() int, createItem func() fyne.CanvasObject, updateItem func(GridWrapItemID, fyne.CanvasObject)) *GridWrap
NewGridWrap creates and returns a GridWrap widget for displaying items in a wrapping grid layout with scrolling and caching for performance.
Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
func NewGridWrapWithData
deprecated
func NewGridWrapWithData(data binding.DataList, createItem func() fyne.CanvasObject, updateItem func(binding.DataItem, fyne.CanvasObject)) *GridWrap
NewGridWrapWithData creates a new GridWrap widget that will display the contents of the provided data.
Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
func (*GridWrap) CreateRenderer ¶
func (l *GridWrap) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer.
func (*GridWrap) GetScrollOffset ¶
GetScrollOffset returns the current scroll offset position
func (*GridWrap) MinSize ¶
func (l *GridWrap) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below.
func (*GridWrap) Resize ¶
func (l *GridWrap) Resize(s fyne.Size)
Resize is called when this GridWrap should change size. We refresh to ensure invisible items are drawn.
func (*GridWrap) ScrollTo ¶
func (l *GridWrap) ScrollTo(id GridWrapItemID)
ScrollTo scrolls to the item represented by id
func (*GridWrap) ScrollToBottom ¶
func (l *GridWrap) ScrollToBottom()
ScrollToBottom scrolls to the end of the list
func (*GridWrap) ScrollToOffset ¶
ScrollToOffset scrolls the list to the given offset position
func (*GridWrap) ScrollToTop ¶
func (l *GridWrap) ScrollToTop()
ScrollToTop scrolls to the start of the list
type GridWrapItemID ¶
type GridWrapItemID = int
GridWrapItemID is the ID of an individual item in the GridWrap widget.
type HexWidget ¶
type HexWidget struct { widget.BaseWidget // contains filtered or unexported fields }
HexWidget represents a 7-segment hexadecimal display. The segments of the display mapped active-low onto 7 state bits, with segment 0 in the least significant bit.
0 ----- | | 5 | | 1 | 6 | ----- | | 4 | | 2 | 3 | -----
func NewHexWidget ¶
func NewHexWidget() *HexWidget
NewHexWidget instantiates a new widget instance, with all of the segments disabled.
func (*HexWidget) CreateRenderer ¶
func (h *HexWidget) CreateRenderer() fyne.WidgetRenderer
CreateRenderer implements fyne.Widget
func (*HexWidget) Set ¶
Set updates the hex widget to show a specific number between 0 and 15, which will be rendered in hexadecimal in 0...f. If the number is greater than 15, it will be modulo-ed by 16.
func (*HexWidget) SetOffColor ¶
SetOffColor changes the color that segments are shown as when they are inactive/off.
func (*HexWidget) SetOnColor ¶
SetOnColor changes the color that segments are shown as when they are active/on.
func (*HexWidget) SetSize ¶
func (h *HexWidget) SetSize(s fyne.Size)
SetSize changes the size of the hex widget.
func (*HexWidget) SetSlant ¶
SetSlant changes the amount of "slant" in the hex widgets. The topmost segment is offset by slant many units to the right. A value of 0 means no slant at all. For example, setting the slant equal to the height should result in a 45 degree angle.
func (*HexWidget) UpdateSegments ¶
UpdateSegments changes the state of the segments and causes the widget to refresh so the changes are visible to the user. Segments values are packed into the 8-bit segments integer, see the documentation for HexWidget for more information on the appropriate packing.
type Map ¶
type Map struct { widget.BaseWidget // contains filtered or unexported fields }
Map widget renders an interactive map using OpenStreetMap tile data.
func NewMapWithOptions ¶
NewMapWithOptions creates a new instance of the map widget with provided map options.
func (*Map) CreateRenderer ¶
func (m *Map) CreateRenderer() fyne.WidgetRenderer
CreateRenderer returns the renderer for this widget. A map renderer is simply the map Raster with user interface elements overlaid.
func (*Map) MinSize ¶
func (m *Map) MinSize() fyne.Size
MinSize returns the smallest possible size for a widget. For our map this is a constant size representing a single tile on a device with the highest known DPI (4x).
type MapOption ¶
type MapOption func(*Map)
MapOption configures the provided map with different features.
func WithAttribution ¶
WithAttribution configures the map widget to display an attribution.
func WithHTTPClient ¶
WithHTTPClient configures the map to use a custom http client.
func WithOsmTiles ¶
func WithOsmTiles() MapOption
WithOsmTiles configures the map to use osm tile source.
func WithScrollButtons ¶
WithScrollButtons enables or disables map scroll controls.
func WithTileSource ¶
WithTileSource configures the map to use a custom tile source.
func WithZoomButtons ¶
WithZoomButtons enables or disables zoom controls.
type NumericalEntry ¶
NumericalEntry is an extended entry that only allows numerical input. Only integers are allowed by default. Support for floats can be enabled by setting AllowFloat.
func NewNumericalEntry ¶
func NewNumericalEntry() *NumericalEntry
NewNumericalEntry returns an extended entry that only allows numerical input.
func (*NumericalEntry) Keyboard ¶
func (e *NumericalEntry) Keyboard() mobile.KeyboardType
Keyboard sets up the right keyboard to use on mobile.
Implements: mobile.Keyboardable
func (*NumericalEntry) TypedRune ¶
func (e *NumericalEntry) TypedRune(r rune)
TypedRune is called when this item receives a char event.
Implements: fyne.Focusable
func (*NumericalEntry) TypedShortcut ¶
func (e *NumericalEntry) TypedShortcut(shortcut fyne.Shortcut)
TypedShortcut handles the registered shortcuts.
Implements: fyne.Shortcutable
type TwoStateToolbarAction ¶
type TwoStateToolbarAction struct { OnActivated func(bool) `json:"-"` // contains filtered or unexported fields }
TwoStateToolbarAction is a push button style of ToolbarItem that displays a different icon depending on its state.
state is a boolean indicating off and on. The actual meaning of the boolean depends on how it is used. For example, in a media play app, false might indicate that the medium file is not being played, and true might indicate that the file is being played. Similarly, the two states could be used to indicate that a panel is being hidden or shown.
func NewTwoStateToolbarAction ¶
func NewTwoStateToolbarAction(offStateIcon fyne.Resource, onStateIcon fyne.Resource, onTapped func(bool)) *TwoStateToolbarAction
NewTwoStateToolbarAction returns a new push button style of Toolbar item that displays a different icon for each of its two states
func (*TwoStateToolbarAction) GetOn ¶
func (t *TwoStateToolbarAction) GetOn() bool
GetOn returns the current state of the toolbaraction
func (*TwoStateToolbarAction) SetOffIcon ¶
func (t *TwoStateToolbarAction) SetOffIcon(icon fyne.Resource)
SetOffIcon sets the icon that is displayed when the state is false
func (*TwoStateToolbarAction) SetOn ¶
func (t *TwoStateToolbarAction) SetOn(on bool)
SetOn sets the state of the toolbaraction
func (*TwoStateToolbarAction) SetOnIcon ¶
func (t *TwoStateToolbarAction) SetOnIcon(icon fyne.Resource)
SetOnIcon sets the icon that is displayed when the state is true
func (*TwoStateToolbarAction) ToolbarObject ¶
func (t *TwoStateToolbarAction) ToolbarObject() fyne.CanvasObject
ToolbarObject gets a button to render this ToolbarAction
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
geometry
Package geometry implements various useful geometric primitives.
|
Package geometry implements various useful geometric primitives. |
geometry/r2
Package r2 implements operations relating to objects in R2.
|
Package r2 implements operations relating to objects in R2. |