Documentation
¶
Overview ¶
Package help is the app's documentation UI: the embedded end-user manual, the About box, and the Help menu that opens either.
It's the one feature package that needs nothing from the viewer - no host interface, no callbacks back into the app. Everything it draws comes from its constructor arguments (the app, for windows and metadata; the app title; the artwork), which is why it was the first extraction of the per-feature split. It also dissolves a mutual dependency that used to exist between the About window and the manual window, since the About box links to the manual: both are methods on one type here.
Help also owns the Hypno Spiral easter egg (internal/ui/spiral), reached only by typing a secret phrase into the manual's search box (see manual.go's secretPhrase and manualView.submit). That doesn't cost this package the "needs nothing from the viewer" property above: the spiral only needs the fyne.App this package already holds, not a callback back into the app. So don't be surprised to find a full-screen shader window living in the help package - the manual is the only door to it.
Index ¶
- type Help
- func (h *Help) ManualOpen() bool
- func (h *Help) Menu() *fyne.Menu
- func (h *Help) OpenSpiral(clockwise bool)
- func (h *Help) SetOnManualClosed(f func())
- func (h *Help) SetOnManualOpened(f func())
- func (h *Help) ShowAbout()
- func (h *Help) ShowManual()
- func (h *Help) ShowWhatsNew(version, body string)
- func (h *Help) WhatsNewOpen() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Help ¶
type Help struct {
// contains filtered or unexported fields
}
Help owns the documentation windows (manual, About, What's New). Each is a widgets.Singleton, so a second request raises the window that's already open instead of stacking up duplicates.
func New ¶
New returns the help UI for application, showing title as the app's name and art as the About box's illustration.
func (*Help) ManualOpen ¶ added in v0.2.4
ManualOpen reports whether the end-user manual window is currently showing.
func (*Help) Menu ¶
Menu is the app's Help menu: the manual, and an About screen below a separator (the usual place for it in a Help menu). Returns the *fyne.Menu itself rather than a whole *fyne.MainMenu, so internal/ui can combine it with its own File menu into one bar - composing menus is the app's job, not this package's, the same "internal/ui decides how features compose" rule the grid/slideshow full-window-mode guard follows (see ARCHITECTURE.md).
func (*Help) OpenSpiral ¶ added in v0.2.0
OpenSpiral opens the Hypno Spiral on the pattern the given gesture direction selects - the easter egg's second door, for the user who swirls the main window in a spiral rather than typing the manual's secret phrase (the gesture itself lives in internal/wingesture, wired up in internal/ui/gesture.go). Which direction picks which pattern is internal/ui/spiral's own business; this only passes the direction on.
It exists so that internal/ui can reach the easter egg without reaching past this package to the *spiral.Spiral it owns: both doors then raise the same window rather than each building one.
func (*Help) SetOnManualClosed ¶ added in v0.2.4
func (h *Help) SetOnManualClosed(f func())
SetOnManualClosed registers f to run when the manual window closes. The field is read at close time, so a Set after ShowManual still fires. nil is a no-op.
func (*Help) SetOnManualOpened ¶ added in v0.2.4
func (h *Help) SetOnManualOpened(f func())
SetOnManualOpened registers f to run after ShowManual raises or builds the window. The field is read at show time. nil is a no-op. Needed so the app can grey Window -> Help on every door into the manual (Help menu, About link, F1), not only the ones that already wrap ShowManual.
func (*Help) ShowAbout ¶
func (h *Help) ShowAbout()
ShowAbout opens the About window: the welcome art on the right, and the app name in a large heading, its version/build, and a link to the manual on the left. A second call while it's still open just raises it instead of stacking up duplicates (see widgets.Singleton).
func (*Help) ShowManual ¶
func (h *Help) ShowManual()
ShowManual opens the manual in its own scrollable window. A second call while the window is still open just raises it instead of opening a duplicate (see widgets.Singleton).
func (*Help) ShowWhatsNew ¶ added in v0.2.6
ShowWhatsNew opens a window with the given release notes body (GitHub markdown). A second call while it's still open raises the existing window instead of stacking a duplicate (see widgets.Singleton). Empty body still opens the window with a translated fallback line. Escape closes; the window is not KeepOnTop and has no Help menu entry.
func (*Help) WhatsNewOpen ¶ added in v0.2.6
WhatsNewOpen reports whether the What's New window is currently showing.