fontlabapp.fontui.appshell.AppShell · declarations 001
Back to fontlabapp.fontui.appshell.AppShell
__init__
__init__(title: str, preview: str | None = None, tabs: Sequence[Any] = (), *, parent: Any = None, package: Callable[[], Any] | None = None)
add_tab
add_tab(spec: Any) -> Any
Build spec into a new tab and return what spec.build returned.
close
close() -> None
current_layer
current_layer() -> str | None
The live master name the app edits: the font's current (default) master.
embed
embed(child: Any) -> Any
Own child: an Owned closes with the shell. Return its widget.
hint_check
hint_check(name: str, layer: str | None = None) -> Any
The live hint state of name on layer (default: the current master), or None.
Studios pass this as hint_check= to the embedded TMetrics/TGlyph so
the guard reads the package the shell writes to.
history
history(label: str, glyphs: Sequence[Any], mutate: Callable[[], Any], *, layers: Sequence[Any], read_back: Callable[[], Sequence[str]] | None = None, operation: str = 'geometry', native: Any = None, allow_bases: bool = False, retain: Sequence[Any] = (), window: int | None = None) -> Any
One named Undo step over explicit live layers; None when refused.
allow_bases=True is the user's "Edit bases of auto glyphs anyway"
opt-in; by default geometry writes to a base of an auto glyph are refused.
retain lists native objects the write removes that Undo must keep
(for example ejected components, fl#7641); empty keeps the plain
two-argument notification. window (a destination package object
id) adds the shared commit's Font-window and no-open-editors guards,
as a write into a font that is not the shell's own needs (Layer
Manager's Copy Layers From Font); None, the default, adds none.
require_history_scope(glyphs) refuses before any write when the
Glyph window would undo only part of it. Refusals, partial writes,
scan timeouts and native/lookup errors are shown in the status line instead of raising.
package
package() -> Any
The live font package the shell writes to, or None.
set_about
set_about(text: str) -> None
Set task help, source links and credits without changing task-tab state.
set_actions
set_actions(tab: Any, *, refresh: Any = None, preview: Any = None, apply: Any = None, dirty: Any = None, ready: Any = None, apply_label: str = 'Apply Changes', status: Any = None) -> None
Bind explicit task actions; ready must validate the accepted plan and target.
status returns the task's own status text; it is shown after Apply so a
refusal the task reports in its panel is not hidden behind "Ready.".
dirty reports staged edits. Refresh refuses to discard them; the task
must expose its own explicit discard/revert action. Tab switches keep state.
set_preview
set_preview(preview: Any) -> Any
Embed the preview widget (TGlyph or TMetrics) in the preview pane.
set_status
set_status(text: str) -> None
show
show() -> None
Initially fit content and equal preview panes; clamp later user resizes.