Documentation
¶
Overview ¶
Package window is the desktop app's window (plan 0009): it joins the session, the workspace, the panes and the notes' views under frostui's chrome. It is the only desktop package that knows all of them.
Index ¶
Constants ¶
const BackgroundPoll = 2 * time.Second
BackgroundPoll is how often the open dialog reads the desktop's answer again (ADR-0033).
const RefreshDelay = 300 * time.Millisecond
RefreshDelay is how long after a change in the vault the panes read again.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Session *session.Session
Prefs prefs.Prefs
State prefs.State
Store *workspace.Store
Catalog *catalog.Catalog
Shell frostui.PaneShell
Dialogs frostui.Dialogs
// contains filtered or unexported fields
}
App is the window's state. UI thread only.
func (*App) RequestClose ¶
func (a *App) RequestClose(done func())
RequestClose saves what is unsaved, and calls done once the window may close: at once when every note reached notesd, else when the user says so (docs/design/app.md#operational-notes).
type Config ¶
type Config struct {
Env notes.Env
Dial session.Dialer
Getenv system.Getenv
Blobs string // notesd's blob store
Version string
Seq int64
ConfigAt string // the preferences' directory
StateAt string // the state's directory
// SetTitle sets the window's title; Close closes it; Quit ends the app.
SetTitle func(string)
Close func()
Quit func()
// PickFolder asks for a folder, "" when cancelled; OpenURL and OpenFile
// open a web link and a vault file outside the app, the link as
// system.WebURL returned it; Copy puts text on the clipboard.
PickFolder func(title string) string
OpenURL func(url string) error
OpenFile func(root, path string) error
Copy func(text string)
Clipboard editor.Clipboard
PickFiles func() []string
}
Config is what the window needs of its surroundings.