widgetExt

package
v0.0.0-...-9d64e4b Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToNRGBA

func ToNRGBA(c color.Color) (r, g, b, a int)

ToNRGBA converts a color to RGBA values which are not premultiplied, unlike color.RGBA().

Types

type ImageButton

type ImageButton struct {
	widget.DisableableWidget
	Text          string
	Image         fyne.Resource
	Importance    widget.ButtonImportance
	Alignment     widget.ButtonAlign
	IconPlacement widget.ButtonIconPlacement

	OnTapped func() `json:"-"`
	// contains filtered or unexported fields
}

ImageButton widget has a text label and a background image that triggers an event func when clicked

func NewImageButton

func NewImageButton(text string, image fyne.Resource, tapped func()) *ImageButton

func (*ImageButton) CreateRenderer

func (imageButton *ImageButton) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*ImageButton) Cursor

func (imageButton *ImageButton) Cursor() desktop.Cursor

Cursor returns the cursor type of this widget

func (*ImageButton) FocusGained

func (imageButton *ImageButton) FocusGained()

FocusGained is a hook called by the focus handling logic after this object gained the focus.

func (*ImageButton) FocusLost

func (imageButton *ImageButton) FocusLost()

FocusLost is a hook called by the focus handling logic after this object lost the focus.

func (*ImageButton) MinSize

func (imageButton *ImageButton) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*ImageButton) MouseIn

func (imageButton *ImageButton) MouseIn(*desktop.MouseEvent)

MouseIn is called when a desktop pointer enters the widget

func (*ImageButton) MouseMoved

func (imageButton *ImageButton) MouseMoved(*desktop.MouseEvent)

MouseMoved is called when a desktop pointer hovers over the widget

func (*ImageButton) MouseOut

func (imageButton *ImageButton) MouseOut()

MouseOut is called when a desktop pointer exits the widget

func (*ImageButton) SetImage

func (imageButton *ImageButton) SetImage(image fyne.Resource)

SetImage updates the image on the image button - pass nil to hide the image.

func (*ImageButton) SetText

func (imageButton *ImageButton) SetText(text string)

SetText allows the button label to be changed

func (*ImageButton) Tapped

func (imageButton *ImageButton) Tapped(*fyne.PointEvent)

Tapped is called when a pointer tapped event is captured and triggers any tap handler

func (*ImageButton) TypedKey

func (imageButton *ImageButton) TypedKey(ev *fyne.KeyEvent)

TypedKey is a hook called by the input handling logic on key events if this object is focused.

func (*ImageButton) TypedRune

func (imageButton *ImageButton) TypedRune(rune)

TypedRune is a hook called by the input handling logic on text input events if this object is focused.

Jump to

Keyboard shortcuts

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