ui

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const PreferencesWindowHeightRatio = 0.8

PreferencesWindowHeightRatio is the ratio of the screen height to use for the preferences window

View Source
const PreferencesWindowWidthRatio = 3.0 / 4.0

PreferencesWindowWidthRatio is the ratio of the window height to use for the window width

Variables

View Source
var SplitAlign = struct {
	Left    Alignment // AlignLeft left-align both widgets.
	Center  Alignment // AlignCenter center-align both widgets.
	Right   Alignment // AlignRight right-align both widgets.
	Opposed Alignment // AlignOpposed align the first widget to the left and the second widget to the right.
}{
	Left:    alignLeft,
	Center:  alignCenter,
	Right:   alignRight,
	Opposed: alignOpposed,
}

SplitAlign is a namespace for the Alignment constants.

View Source
var SplitProportion = struct {
	OneThird     FirstWidgetProportion // OneThird 1/3 - 2/3
	OneFourth    FirstWidgetProportion // OneFourth 1/4 - 3/4
	OneFifth     FirstWidgetProportion // OneFifth 1/5 - 4/5
	TwoFifths    FirstWidgetProportion // TwoFifths 2/5 - 3/5
	TwoThirds    FirstWidgetProportion // TwoThirds 2/3 - 1/3
	ThreeFourths FirstWidgetProportion // ThreeFourths 3/4 - 1/4
	FourFifths   FirstWidgetProportion // FourFifths 4/5 - 1/5
	ThreeFifths  FirstWidgetProportion // ThreeFifths 3/5 - 2/5
}{
	OneThird:     oneThird,
	OneFourth:    oneFourth,
	OneFifth:     oneFifth,
	TwoFifths:    twoFifths,
	TwoThirds:    twoThirds,
	ThreeFourths: threeFourths,
	FourFifths:   fourFifths,
	ThreeFifths:  threeFifths,
}

SplitProportion is a namespace for the FirstWidgetProportion constants. This is the key change.

Functions

func GetApplication added in v0.3.1

func GetApplication() ui.App

GetApplication returns the singleton instance of the application

func GetPluginManager added in v0.3.1

func GetPluginManager() ui.PluginManager

GetPluginManager returns the singleton instance of the application as a UIPluginManager

func NewSettingsManager added in v0.3.3

func NewSettingsManager(window fyne.Window) setting.SettingsManager

NewSettingsManager creates a new SettingsManager.

func NewSplitRow added in v0.3.1

func NewSplitRow(widget1, widget2 fyne.CanvasObject, proportion FirstWidgetProportion) *fyne.Container

NewSplitRow creates a split row with default (left) alignment.

func NewSplitRowWithAlignment added in v0.3.1

func NewSplitRowWithAlignment(widget1, widget2 fyne.CanvasObject, proportion FirstWidgetProportion, alignment Alignment) *fyne.Container

NewSplitRowWithAlignment creates a split row with specified alignment and proportion.

Types

type Alignment added in v0.3.1

type Alignment int

Alignment specifies the horizontal alignment.

type FirstWidgetProportion added in v0.3.1

type FirstWidgetProportion int

FirstWidgetProportion represents the predefined split ratios.

type OS added in v0.5.1

type OS interface {
	// TransformToForeground changes the application to be a regular app with a Dock icon.
	TransformToForeground()
	// TransformToBackground changes the application to be a background-only app.
	TransformToBackground()
	// SetupLifecycle sets up OS-specific lifecycle hooks.
	// This is where Chrome OS "fake tray" logic resides.
	SetupLifecycle(app fyne.App, sa *SpiceApp)
}

OS interface defines methods for transforming the application state to foreground or background. This is useful for managing the application behavior on different operating systems, such as macOS where background apps do not show a Dock icon.

type SettingsManager added in v0.3.3

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

SettingsManager handles UI elements for settings.

func (*SettingsManager) CreateBoolSetting added in v0.3.3

func (sm *SettingsManager) CreateBoolSetting(cfg *setting.BoolConfig, header *fyne.Container) *widget.Check

CreateBoolSetting creates a reusable boolean check setting.

func (*SettingsManager) CreateButtonWithConfirmationSetting added in v0.3.3

func (sm *SettingsManager) CreateButtonWithConfirmationSetting(cfg *setting.ButtonWithConfirmationConfig, header *fyne.Container)

CreateButtonWithConfirmationSetting creates a reusable button setting with confirmation dialog.

func (*SettingsManager) CreateSectionTitleLabel added in v0.3.3

func (sm *SettingsManager) CreateSectionTitleLabel(desc string) *widget.Label

CreateSectionTitleLabel creates a label for a setting title

func (*SettingsManager) CreateSelectSetting added in v0.3.3

func (sm *SettingsManager) CreateSelectSetting(cfg *setting.SelectConfig, header *fyne.Container)

CreateSelectSetting creates a reusable select widget.

func (*SettingsManager) CreateSettingDescriptionLabel added in v0.3.3

func (sm *SettingsManager) CreateSettingDescriptionLabel(desc string) fyne.CanvasObject

CreateSettingDescriptionLabel creates a label for a setting description

func (*SettingsManager) CreateSettingTitleLabel added in v0.3.3

func (sm *SettingsManager) CreateSettingTitleLabel(desc string) *widget.Label

CreateSettingTitleLabel creates a label for a setting title

func (*SettingsManager) CreateTextEntrySetting added in v0.3.3

func (sm *SettingsManager) CreateTextEntrySetting(cfg *setting.TextEntrySettingConfig, header *fyne.Container)

CreateTextEntrySetting creates a reusable text entry setting.

func (*SettingsManager) GetApplySettingsButton added in v0.3.3

func (sm *SettingsManager) GetApplySettingsButton() *widget.Button

GetApplySettingsButton returns the Apply Changes button from the SettingsManager to be used in the UI.

func (*SettingsManager) GetCheckAndEnableApplyFunc added in v0.3.3

func (sm *SettingsManager) GetCheckAndEnableApplyFunc() func()

GetCheckAndEnableApplyFunc returns the check and enable apply function for the SettingsManager.

func (*SettingsManager) GetSettingsWindow added in v0.3.3

func (sm *SettingsManager) GetSettingsWindow() fyne.Window

GetSettingsWindow returns the window associated with the SettingsManager.

func (*SettingsManager) RebuildTrayMenu added in v1.5.0

func (sm *SettingsManager) RebuildTrayMenu()

RebuildTrayMenu rebuilds the tray menu list from scratch.

func (*SettingsManager) RegisterOnSettingsSaved added in v1.6.0

func (sm *SettingsManager) RegisterOnSettingsSaved(callback func())

RegisterOnSettingsSaved registers a function to be called after settings are applied.

func (*SettingsManager) RegisterRefreshFunc added in v0.3.3

func (sm *SettingsManager) RegisterRefreshFunc(refreshFunc func())

RegisterRefreshFunc registers a function to be called when the settings need to be refreshed. This should be done by each plugin that needs to perform some action after settings changes. Like refreshing all wallpaper images for example.

func (*SettingsManager) RemoveSettingChangedCallback added in v0.3.3

func (sm *SettingsManager) RemoveSettingChangedCallback(settingName string)

RemoveSettingChangedCallback removes a callback function associated with a specific setting.

func (*SettingsManager) SetRefreshFlag added in v0.3.3

func (sm *SettingsManager) SetRefreshFlag(settingName string)

SetRefreshFlag sets a flag to indicate that a specific setting needs a refresh.

func (*SettingsManager) SetSettingChangedCallback added in v0.3.3

func (sm *SettingsManager) SetSettingChangedCallback(settingName string, callback func())

SetSettingChangedCallback sets a callback function to be called when a setting changes.

func (*SettingsManager) UnsetRefreshFlag added in v0.3.3

func (sm *SettingsManager) UnsetRefreshFlag(settingName string)

UnsetRefreshFlag removes the refresh flag for a specific setting.

type SpiceApp

type SpiceApp struct {
	fyne.App
	// contains filtered or unexported fields
}

SpiceApp represents the application

func (*SpiceApp) CreateAboutSplash added in v1.5.0

func (sa *SpiceApp) CreateAboutSplash()

CreateAboutSplash creates an animated splash screen for the "About" dialog.

func (*SpiceApp) CreateMenuItem added in v0.3.1

func (sa *SpiceApp) CreateMenuItem(label string, action func(), iconName string) *fyne.MenuItem

CreateMenuItem creates a menu item with the given label, action, and icon

func (*SpiceApp) CreatePreferencesWindow added in v0.2.1

func (sa *SpiceApp) CreatePreferencesWindow(initialTab string)

CreatePreferencesWindow creates and displays a new window for the application's preferences. The window is titled "Preferences" and is sized to 800x600 pixels, centered on the screen. It contains a main container for wallpaper plugin preferences and a close button at the bottom. The close button closes the preferences window when clicked. CreatePreferencesWindow creates and displays a new window for the application's preferences. The window is titled "Preferences" and is sized to 800x600 pixels, centered on the screen. It contains a main container for wallpaper plugin preferences and a close button at the bottom. The close button closes the preferences window when clicked. CreatePreferencesWindow creates and displays a new window for the application's preferences. The window is titled "Preferences" and is sized to 800x600 pixels, centered on the screen. It contains a main container for wallpaper plugin preferences and a close button at the bottom. The close button closes the preferences window when clicked.

func (*SpiceApp) CreateSplashScreen

func (sa *SpiceApp) CreateSplashScreen(seconds int)

CreateSplashScreen creates a splash screen for the application

func (*SpiceApp) CreateToggleMenuItem added in v0.3.1

func (sa *SpiceApp) CreateToggleMenuItem(label string, action func(bool), iconName string, checked bool) *fyne.MenuItem

CreateToggleMenuItem creates a toggle menu item with the given label, action, icon, and checked state

func (*SpiceApp) CreateTrayMenu

func (sa *SpiceApp) CreateTrayMenu()

CreateTrayMenu creates the tray menu for the application

func (*SpiceApp) Deregister added in v0.3.1

func (sa *SpiceApp) Deregister(plugin ui.Plugin)

Deregister deregisters a plugin from the application

func (*SpiceApp) GetAssetManager added in v0.6.1

func (sa *SpiceApp) GetAssetManager() *asset.Manager

GetAssetManager returns the asset manager

func (*SpiceApp) GetPreferences added in v0.3.1

func (sa *SpiceApp) GetPreferences() fyne.Preferences

GetPreferences returns the preferences for the application

func (*SpiceApp) NotifyUser added in v0.3.1

func (sa *SpiceApp) NotifyUser(title, message string)

NotifyUser sends a notification to the user via all registered notifiers

func (*SpiceApp) OpenPreferences added in v1.4.0

func (sa *SpiceApp) OpenPreferences(tab string)

OpenPreferences opens the preferences window

func (*SpiceApp) RebuildPreferencesContent added in v1.6.0

func (sa *SpiceApp) RebuildPreferencesContent(initialTab string)

RebuildPreferencesContent rebuilds the content of the preferences window. This allows refreshing the UI (e.g. to show "Add Query" dialogs) even if the window is already open.

func (*SpiceApp) RebuildTrayMenu added in v1.5.0

func (sa *SpiceApp) RebuildTrayMenu()

RebuildTrayMenu rebuilds the tray menu list from scratch.

func (*SpiceApp) RefreshTrayMenu added in v1.0.0

func (sa *SpiceApp) RefreshTrayMenu()

RefreshTrayMenu refreshes the tray menu

func (*SpiceApp) Register added in v0.3.1

func (sa *SpiceApp) Register(plugin ui.Plugin)

Register registers a plugin with the application

func (*SpiceApp) RegisterNotifier added in v0.3.1

func (sa *SpiceApp) RegisterNotifier(notifier ui.Notifier)

RegisterNotifier registers a notifier with the application

func (*SpiceApp) Start added in v0.3.1

func (sa *SpiceApp) Start()

Start activates all plugins and runs the Fyne application

func (*SpiceApp) StartPeriodicUpdateCheck added in v0.5.3

func (sa *SpiceApp) StartPeriodicUpdateCheck()

StartPeriodicUpdateCheck starts a goroutine to check for updates on startup and then periodically.

Jump to

Keyboard shortcuts

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