core

package
v0.76.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 55 Imported by: 0

Documentation

Overview

Package core provides the core components to construct the UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DesktopUI

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

The DesktopUI creates the UI for desktop.

func NewDesktopUI

func NewDesktopUI(params UIParams) *DesktopUI

NewDesktopUI build the UI and returns it.

func (DesktopUI) Character

func (u DesktopUI) Character() *characterservice.CharacterService

func (DesktopUI) ClearAllCaches

func (u DesktopUI) ClearAllCaches()

func (DesktopUI) Corporation

func (u DesktopUI) Corporation() *corporationservice.CorporationService

func (DesktopUI) CurrentCharacter

func (u DesktopUI) CurrentCharacter() *app.Character

CurrentCharacter() returns the current character or nil when none is configured.

func (DesktopUI) CurrentCorporation

func (u DesktopUI) CurrentCorporation() *app.Corporation

CurrentCorporation returns the current corporation or nil if not set.

func (DesktopUI) DataPaths

func (u DesktopUI) DataPaths() xmaps.OrderedMap[string, string]

func (DesktopUI) DestroyWindow added in v0.65.3

func (u DesktopUI) DestroyWindow(id string) bool

DestroyWindow tries to destroy a window and reports whether it was successful.

func (DesktopUI) DisplaySnackbar added in v0.74.0

func (u DesktopUI) DisplaySnackbar(text string)

func (DesktopUI) DisplaySnackbarWithTimeout added in v0.74.0

func (u DesktopUI) DisplaySnackbarWithTimeout(text string, timeout time.Duration)

func (DesktopUI) ESIStatus

func (u DesktopUI) ESIStatus() *esistatusservice.ESIStatusService

func (DesktopUI) EVEImage

func (u DesktopUI) EVEImage() ui.EVEImageService

func (DesktopUI) EVEUniverse

func (u DesktopUI) EVEUniverse() *eveuniverseservice.EVEUniverseService

func (DesktopUI) ErrorDisplay

func (u DesktopUI) ErrorDisplay(err error) string

ErrorDisplay returns a user friendly error message for an error. Or returns the full error when in developer mode.

func (DesktopUI) GetOrCreateWindow

func (u DesktopUI) GetOrCreateWindow(id string, titles ...string) (window fyne.Window, created bool)

GetOrCreateWindow returns a unique window as defined by the given id string and reports whether a new window was created or the window already exists. When id is zero it will always create a new window.

func (DesktopUI) GetOrCreateWindowWithOnClosed

func (u DesktopUI) GetOrCreateWindowWithOnClosed(id string, titles ...string) (window fyne.Window, created bool, onClosed func())

GetOrCreateWindowWithOnClosed is like GetOrCreateWindow, but returns an additional onClosed function which must be called when the window is closed. This allows constructing a custom onClosed callback for the window.

func (DesktopUI) Go added in v0.76.0

func (u DesktopUI) Go(job func(ctx context.Context)) bool

Go runs job in the background. Shutdown cancels the job and waits for it. Reports false when the job was not started because the UI was stopped.

func (DesktopUI) InfoViewer

func (u DesktopUI) InfoViewer() ui.InfoViewer

InfoViewer returns the info window.

func (DesktopUI) IsDeveloperMode

func (u DesktopUI) IsDeveloperMode() bool

func (DesktopUI) IsMobile

func (u DesktopUI) IsMobile() bool

func (DesktopUI) IsOffline

func (u DesktopUI) IsOffline() bool

func (DesktopUI) IsUpdateDisabled

func (u DesktopUI) IsUpdateDisabled() bool

func (DesktopUI) Janice

func (u DesktopUI) Janice() *janiceservice.JaniceService

func (DesktopUI) ListCorporationsForSelection

func (u DesktopUI) ListCorporationsForSelection(ctx context.Context) ([]*app.EntityShort, error)

func (DesktopUI) LoadCharacter

func (u DesktopUI) LoadCharacter(ctx context.Context, id int64) error

func (DesktopUI) LoadCorporation

func (u DesktopUI) LoadCorporation(ctx context.Context, id int64) error

func (DesktopUI) MainWindow

func (u DesktopUI) MainWindow() fyne.Window

func (DesktopUI) MakeWindowTitle

func (u DesktopUI) MakeWindowTitle(parts ...string) string

MakeWindowTitle creates a standardized title for a window.

func (DesktopUI) ReloadCurrentCharacter

func (u DesktopUI) ReloadCurrentCharacter(ctx context.Context)

ReloadCurrentCharacter reloads the current character from storage.

func (DesktopUI) ResetCharacter

func (u DesktopUI) ResetCharacter(_ context.Context)

func (DesktopUI) ResetCorporation

func (u DesktopUI) ResetCorporation(_ context.Context)

func (DesktopUI) SetAnyCharacter

func (u DesktopUI) SetAnyCharacter(ctx context.Context) error

func (DesktopUI) SetAnyCorporation

func (u DesktopUI) SetAnyCorporation(ctx context.Context) error

func (DesktopUI) SetCharacter

func (u DesktopUI) SetCharacter(_ context.Context, c *app.Character)

func (DesktopUI) SetCharacterAvatarAsync added in v0.75.0

func (u DesktopUI) SetCharacterAvatarAsync(characterID int64, setIcon func(fyne.Resource))

SetCharacterAvatarAsync sets a character's avatar with setIcon. setIcon is called at once with a cached avatar or placeholder, and again on the main thread after loading.

func (DesktopUI) SetColorTheme

func (u DesktopUI) SetColorTheme(s settings.ColorTheme)

func (DesktopUI) SetCorporation

func (u DesktopUI) SetCorporation(_ context.Context, c *app.Corporation)

func (DesktopUI) SetDeveloperMode

func (u DesktopUI) SetDeveloperMode(b bool)

func (DesktopUI) Settings

func (u DesktopUI) Settings() *settings.Settings

func (DesktopUI) ShowAndRun

func (u DesktopUI) ShowAndRun()

ShowAndRun shows the UI and runs the Fyne loop (blocking),

func (DesktopUI) ShowCharacter

func (u DesktopUI) ShowCharacter(ctx context.Context, characterID int64)

func (DesktopUI) ShowCorporation added in v0.76.0

func (u DesktopUI) ShowCorporation(ctx context.Context, corporationID int64)

func (DesktopUI) Signals

func (u DesktopUI) Signals() *app.Signals

func (DesktopUI) StatusCache

func (u DesktopUI) StatusCache() *statuscache.StatusCache

func (DesktopUI) UpdateMailIndicator

func (u DesktopUI) UpdateMailIndicator(ctx context.Context)

type MobileUI

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

MobileUI creates the UI for mobile.

func NewMobileUI

func NewMobileUI(params UIParams) *MobileUI

NewMobileUI builds the UI and returns it.

func (MobileUI) Character

func (u MobileUI) Character() *characterservice.CharacterService

func (MobileUI) ClearAllCaches

func (u MobileUI) ClearAllCaches()

func (MobileUI) Corporation

func (u MobileUI) Corporation() *corporationservice.CorporationService

func (MobileUI) CurrentCharacter

func (u MobileUI) CurrentCharacter() *app.Character

CurrentCharacter() returns the current character or nil when none is configured.

func (MobileUI) CurrentCorporation

func (u MobileUI) CurrentCorporation() *app.Corporation

CurrentCorporation returns the current corporation or nil if not set.

func (MobileUI) DataPaths

func (u MobileUI) DataPaths() xmaps.OrderedMap[string, string]

func (MobileUI) DestroyWindow added in v0.65.3

func (u MobileUI) DestroyWindow(id string) bool

DestroyWindow tries to destroy a window and reports whether it was successful.

func (MobileUI) DisplaySnackbar added in v0.74.0

func (u MobileUI) DisplaySnackbar(text string)

func (MobileUI) DisplaySnackbarWithTimeout added in v0.74.0

func (u MobileUI) DisplaySnackbarWithTimeout(text string, timeout time.Duration)

func (MobileUI) ESIStatus

func (u MobileUI) ESIStatus() *esistatusservice.ESIStatusService

func (MobileUI) EVEImage

func (u MobileUI) EVEImage() ui.EVEImageService

func (MobileUI) EVEUniverse

func (u MobileUI) EVEUniverse() *eveuniverseservice.EVEUniverseService

func (MobileUI) ErrorDisplay

func (u MobileUI) ErrorDisplay(err error) string

ErrorDisplay returns a user friendly error message for an error. Or returns the full error when in developer mode.

func (MobileUI) GetOrCreateWindow

func (u MobileUI) GetOrCreateWindow(id string, titles ...string) (window fyne.Window, created bool)

GetOrCreateWindow returns a unique window as defined by the given id string and reports whether a new window was created or the window already exists. When id is zero it will always create a new window.

func (MobileUI) GetOrCreateWindowWithOnClosed

func (u MobileUI) GetOrCreateWindowWithOnClosed(id string, titles ...string) (window fyne.Window, created bool, onClosed func())

GetOrCreateWindowWithOnClosed is like GetOrCreateWindow, but returns an additional onClosed function which must be called when the window is closed. This allows constructing a custom onClosed callback for the window.

func (MobileUI) Go added in v0.76.0

func (u MobileUI) Go(job func(ctx context.Context)) bool

Go runs job in the background. Shutdown cancels the job and waits for it. Reports false when the job was not started because the UI was stopped.

func (MobileUI) InfoViewer

func (u MobileUI) InfoViewer() ui.InfoViewer

InfoViewer returns the info window.

func (MobileUI) IsDeveloperMode

func (u MobileUI) IsDeveloperMode() bool

func (MobileUI) IsMobile

func (u MobileUI) IsMobile() bool

func (MobileUI) IsOffline

func (u MobileUI) IsOffline() bool

func (MobileUI) IsUpdateDisabled

func (u MobileUI) IsUpdateDisabled() bool

func (MobileUI) Janice

func (u MobileUI) Janice() *janiceservice.JaniceService

func (MobileUI) ListCorporationsForSelection

func (u MobileUI) ListCorporationsForSelection(ctx context.Context) ([]*app.EntityShort, error)

func (MobileUI) LoadCharacter

func (u MobileUI) LoadCharacter(ctx context.Context, id int64) error

func (MobileUI) LoadCorporation

func (u MobileUI) LoadCorporation(ctx context.Context, id int64) error

func (MobileUI) MainWindow

func (u MobileUI) MainWindow() fyne.Window

func (MobileUI) MakeWindowTitle

func (u MobileUI) MakeWindowTitle(parts ...string) string

MakeWindowTitle creates a standardized title for a window.

func (MobileUI) ReloadCurrentCharacter

func (u MobileUI) ReloadCurrentCharacter(ctx context.Context)

ReloadCurrentCharacter reloads the current character from storage.

func (MobileUI) ResetCharacter

func (u MobileUI) ResetCharacter(_ context.Context)

func (MobileUI) ResetCorporation

func (u MobileUI) ResetCorporation(_ context.Context)

func (MobileUI) SetAnyCharacter

func (u MobileUI) SetAnyCharacter(ctx context.Context) error

func (MobileUI) SetAnyCorporation

func (u MobileUI) SetAnyCorporation(ctx context.Context) error

func (MobileUI) SetCharacter

func (u MobileUI) SetCharacter(_ context.Context, c *app.Character)

func (MobileUI) SetCharacterAvatarAsync added in v0.75.0

func (u MobileUI) SetCharacterAvatarAsync(characterID int64, setIcon func(fyne.Resource))

SetCharacterAvatarAsync sets a character's avatar with setIcon. setIcon is called at once with a cached avatar or placeholder, and again on the main thread after loading.

func (MobileUI) SetColorTheme

func (u MobileUI) SetColorTheme(s settings.ColorTheme)

func (MobileUI) SetCorporation

func (u MobileUI) SetCorporation(_ context.Context, c *app.Corporation)

func (MobileUI) SetDeveloperMode

func (u MobileUI) SetDeveloperMode(b bool)

func (MobileUI) Settings

func (u MobileUI) Settings() *settings.Settings

func (MobileUI) ShowAndRun

func (u MobileUI) ShowAndRun()

ShowAndRun shows the UI and runs the Fyne loop (blocking),

func (MobileUI) ShowCharacter

func (u MobileUI) ShowCharacter(ctx context.Context, characterID int64)

func (MobileUI) ShowCorporation added in v0.76.0

func (u MobileUI) ShowCorporation(ctx context.Context, corporationID int64)

func (MobileUI) Signals

func (u MobileUI) Signals() *app.Signals

func (MobileUI) StatusCache

func (u MobileUI) StatusCache() *statuscache.StatusCache

func (MobileUI) UpdateMailIndicator

func (u MobileUI) UpdateMailIndicator(ctx context.Context)

type StatusBarItem added in v0.65.0

type StatusBarItem struct {
	ttwidget.ToolTipWidget

	// The function that is called when the label is tapped.
	OnTapped func()
	// contains filtered or unexported fields
}

StatusBarItem is a widget with a label and an optional icon, which can be tapped.

func NewStatusBarItem added in v0.65.0

func NewStatusBarItem(leading fyne.Resource, text string, tapped func()) *StatusBarItem

func NewStatusBarItemWithTrailing added in v0.65.0

func NewStatusBarItemWithTrailing(leading fyne.Resource, trailing fyne.CanvasObject, text string, tapped func()) *StatusBarItem

func (*StatusBarItem) CreateRenderer added in v0.65.0

func (w *StatusBarItem) CreateRenderer() fyne.WidgetRenderer

func (*StatusBarItem) MouseIn added in v0.65.0

func (w *StatusBarItem) MouseIn(e *desktop.MouseEvent)

func (*StatusBarItem) MouseMoved added in v0.65.0

func (w *StatusBarItem) MouseMoved(e *desktop.MouseEvent)

func (*StatusBarItem) MouseOut added in v0.65.0

func (w *StatusBarItem) MouseOut()

func (*StatusBarItem) Refresh added in v0.65.0

func (w *StatusBarItem) Refresh()

func (*StatusBarItem) SetLeading added in v0.65.0

func (w *StatusBarItem) SetLeading(icon fyne.Resource)

SetLeading updates the leading icon. A nil icon hides it.

func (*StatusBarItem) SetText added in v0.65.0

func (w *StatusBarItem) SetText(text string)

SetText updates the label's text. And resets its importance to medium.

func (*StatusBarItem) SetTextAndImportance added in v0.65.0

func (w *StatusBarItem) SetTextAndImportance(text string, importance widget.Importance)

SetTextAndImportance updates the label's text and importance.

func (*StatusBarItem) Tapped added in v0.65.0

func (w *StatusBarItem) Tapped(_ *fyne.PointEvent)

type UIParams

type UIParams struct {
	App         fyne.App
	Character   *characterservice.CharacterService
	Corporation *corporationservice.CorporationService
	ESIStatus   *esistatusservice.ESIStatusService
	EVEImage    ui.EVEImageService
	EVEUniverse *eveuniverseservice.EVEUniverseService
	Janice      *janiceservice.JaniceService
	StatusCache *statuscache.StatusCache
	Signals     *app.Signals
	Settings    *settings.Settings
	// optional
	ClearCacheFunc   func()
	ConcurrencyLimit int
	DataPaths        map[string]string
	IsFakeMobile     bool
	IsMobile         bool
	IsOfflineMode    bool
	IsUpdateDisabled bool
}

Jump to

Keyboard shortcuts

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