Skip to content

Settings API

Andy Williams edited this page Feb 16, 2019 · 20 revisions

To provide a clean and consistent API for settings and configuration we need to be clear about what is application local (settings and user configuration) vs global (system settings). Also some things can be set by environment variables to override settings.

App.Settings

Theme

An application theme settings inherits from the global setting. It can be overridden by the user with FYNE_THEME. It can also be set by the application if the developer wants to use a custom theme.

App.Configuration

Get(key):value access a user configuration that was stored previously.

Set(key, value) would allow an application to store a user configuration for later access.

Typed versions (like GetFloat or SetBool) could improve the API.

We should support complex types as well - see JSON or XML marshalling for potential inspiration.

App.Storage

A place where an application can get storage access information / functions

Cache

The correct location to cache documents or assets that you don't want to keep in memory.

Documents

A place where the application can store user documents - within the standard user documents directory.

Global Settings

Theme

The user can set their preferred theme that will apply to applications if they don't override.

Welcome to the Fyne wiki.

Project documentation

Getting involved

Platform details

Clone this wiki locally