preferences

package
v0.0.0-...-7e30b41 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolPreference

type BoolPreference struct {
	Key      string
	Value    binding.Bool
	Fallback bool
}

Preference that is stored as a boolean key: the key of the preference, has to be unique across all preferences

func (BoolPreference) GetKey

func (b BoolPreference) GetKey() string

type IntArrayPreference

type IntArrayPreference struct {
	Key      string
	Value    xbinding.IntArray
	Fallback []int
}

func (IntArrayPreference) GetKey

func (i IntArrayPreference) GetKey() string

type IntPreference

type IntPreference struct {
	Key      string
	Value    binding.Int
	Fallback int
}

Preference that is stored as an int key: the key of the preference, has to be unique across all preferences

func (IntPreference) GetKey

func (i IntPreference) GetKey() string

type Keyed

type Keyed interface {
	GetKey() string
}

type PreferencesSynchronizer

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

PreferencesSynchronizer is used to sync preferences between bindings and the fyne preferences

func NewPreferencesSynchronizer

func NewPreferencesSynchronizer(app fyne.App) *PreferencesSynchronizer

Creates a new preferences sync that can be used to sync preferences with the fyne preferences Remark: all bindings have to be initialized before calling this function

func (*PreferencesSynchronizer) AddBool

Adds a new bool preference to the synchronizer and sets the value to the current value of the preference or the fallback value if the preference is not set

func (*PreferencesSynchronizer) AddInt

Adds a new int preference to the synchronizer and sets the value to the current value of the preference or the fallback value if the preference is not set

func (*PreferencesSynchronizer) AddIntArray

Adds a new int array preference to the synchronizer and sets the value to the current value of the preference or the fallback value if the preference is not set

func (*PreferencesSynchronizer) AddString

Adds a new string preference to the synchronizer and sets the value to the current value of the preference or the fallback value if the preference is not set

type StringPreference

type StringPreference struct {
	Key      string
	Value    binding.String
	Fallback string
}

Preference that is stored as a string key: the key of the preference, has to be unique across all preferences

func (StringPreference) GetKey

func (s StringPreference) GetKey() string

Jump to

Keyboard shortcuts

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