util

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BoldRichTextStyle = widget.RichTextStyle{TextStyle: fyne.TextStyle{Bold: true}, Inline: true}

Functions

func AddHeaderBackground added in v0.7.0

func AddHeaderBackground(obj fyne.CanvasObject) *fyne.Container

func BytesToSizeString

func BytesToSizeString(bytes int64) string

func DisplayReleaseType added in v0.9.0

func DisplayReleaseType(releaseTypes mediaprovider.ReleaseTypes) string

func FindTrackByID added in v0.10.0

func FindTrackByID(tracks []*TrackListModel, id string) (*mediaprovider.Track, int)

func ImageAspect

func ImageAspect(im image.Image) float32

func MakeOpaque added in v0.9.1

func MakeOpaque(c color.Color) color.Color

func NewDebouncer

func NewDebouncer(dur time.Duration, callOnDone func()) func()

Debouncer returns a function that will call callOnDone when it has not been invoked since the last dur interval.

func NewRatingSubmenu

func NewRatingSubmenu(onSetRating func(int)) *fyne.MenuItem

func NewReorderTracksSubmenu added in v0.9.0

func NewReorderTracksSubmenu(onReorderTracks func(sharedutil.TrackReorderOp)) *fyne.MenuItem

func NewTrailingAlignLabel added in v0.10.0

func NewTrailingAlignLabel() *widget.Label

func NewTruncatingLabel added in v0.10.0

func NewTruncatingLabel() *widget.Label

func NewTruncatingRichText added in v0.10.0

func NewTruncatingRichText() *widget.RichText

func PlaintextFromHTMLString added in v0.8.1

func PlaintextFromHTMLString(s string) string

func SecondsToTimeString

func SecondsToTimeString(s float64) string

func SelectAllTracks added in v0.10.0

func SelectAllTracks(tracks []*TrackListModel)

func SelectTrack added in v0.10.0

func SelectTrack(tracks []*TrackListModel, idx int)

func SelectTrackRange added in v0.10.0

func SelectTrackRange(tracks []*TrackListModel, idx int)

func SelectedTrackIDs added in v0.10.0

func SelectedTrackIDs(tracks []*TrackListModel) []string

func SelectedTracks added in v0.10.0

func SelectedTracks(tracks []*TrackListModel) []*mediaprovider.Track

func UnselectAllTracks added in v0.10.0

func UnselectAllTracks(tracks []*TrackListModel)

Types

type HSpace

type HSpace struct {
	widget.BaseWidget

	Width float32
}

func NewHSpace

func NewHSpace(w float32) *HSpace

func (*HSpace) CreateRenderer

func (h *HSpace) CreateRenderer() fyne.WidgetRenderer

func (*HSpace) MinSize

func (h *HSpace) MinSize() fyne.Size

type ImageFetcher added in v0.7.0

type ImageFetcher interface {
	GetCoverThumbnailFromCache(string) (image.Image, bool)
	GetCoverThumbnailAsync(string, func(image.Image, error)) context.CancelFunc
}

Image backend interface for the ThumbnailLoader impl: backend.ImageManager

type ThumbnailLoader added in v0.7.0

type ThumbnailLoader struct {
	OnBeforeLoad func()
	OnLoaded     func(image.Image)
	// contains filtered or unexported fields
}

ThumbnailLoader is a utility type that exposes a single API to load a cover thumbnail by ID. If the image is immediately available in the cache, OnLoaded will be called immediately. If it is not, OnBeforeLoad will be called first, then OnLoaded will be called async once the image is available. Any subsequent calls to Load will cancel the previous load if not yet completed.

func NewThumbnailLoader added in v0.7.0

func NewThumbnailLoader(im ImageFetcher, onLoaded func(image.Image)) ThumbnailLoader

func (*ThumbnailLoader) Load added in v0.7.0

func (i *ThumbnailLoader) Load(coverID string)

type TrackListModel added in v0.10.0

type TrackListModel struct {
	Track    *mediaprovider.Track
	Selected bool
}

func ToTrackListModels added in v0.10.0

func ToTrackListModels(trs []*mediaprovider.Track) []*TrackListModel

type WidgetPool added in v0.5.0

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

A pool to share commonly-used widgets across pages to reduce creation of new widgets and memory allocations.

func NewWidgetPool added in v0.5.0

func NewWidgetPool() *WidgetPool

func (*WidgetPool) Obtain added in v0.5.0

func (w *WidgetPool) Obtain(typ WidgetType) fyne.CanvasObject

Obtain obtains a widget of the given type from the pool, if one exists. Returns nil if there is no available widget.

func (*WidgetPool) Release added in v0.5.0

func (w *WidgetPool) Release(typ WidgetType, wid fyne.CanvasObject)

Release releases a widget into the pool. The widget must not be modified by the releaser after release, since it may be Obtained for a new use at any time.

type WidgetType added in v0.5.0

type WidgetType int
const (
	WidgetTypeAlbumPageHeader WidgetType = iota
	WidgetTypeArtistPageHeader
	WidgetTypeGridView
	WidgetTypePlaylistPageHeader
	WidgetTypeTracklist
	WidgetTypeNowPlayingPage
)

Jump to

Keyboard shortcuts

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