Skip to main content

Module frame

Module frame 

Source
Expand description

The frame every app shares (Shell): an app hands it its registry, its workspaces, its menus and its Settings sections (ShellSpec), and the frame draws them the same way in every app (Affinity’s layout):

  • Title bar: the app’s menu (named after the app: files, Settings) and Help at the left, then the workspace switcher; at the right the project, the remote button (where the app runs), the layout toggles (commands, as icon buttons) and the theme.
  • Menu row: the current workspace’s menus, built from the registry.
  • Body: the current workspace’s view, a card on the chrome.
  • Status bar: a status line, the running jobs (crate::jobs) with a cancel button each, and this computer’s load (CPU, memory).
  • Settings (Ctrl+,): sections on the left (Appearance, built in, then the app’s), the section’s settings on the right.
  • Search (Ctrl+K, F3) over the registry.
  • Window frame: where the app draws its own frame (client-side decorations on Linux), the window has rounded corners while it floats and resizes from its own edge; no shadow margin (compositors that do not draw it showed what was behind the window there).
  • Overlay: one view of the app’s over everything (Shell::set_overlay: a help sheet, a dialog).

The frame adds its own commands to the registry (shell.search, shell.settings, shell.theme, shell.workspace.<id>), so they are in the search and an agent’s tools too.

Structs§

RemoteSpec
Where the app runs, at the right of the title bar (as VS Code’s remote indicator): this computer, or a server. Its menu lists the places.
SettingsSection
A section of Settings an app registers (Compute, Models, Plugins…).
Shell
The frame.
ShellSpec
What an app hands the frame.
WorkspaceSpec
A workspace of the app (Explore, Pipeline, Analyze; Sorting…).

Enums§

ShellEvent
What the frame tells the app.

Constants§

MENU_ROW_H
Height of the menu row (px).
RESIZE_BAND
The band at the window’s own edge that resizes it while it floats (px).
STATUS_BAR_H
Height of the status bar (px): one 24 px target.
TITLE_BAR_H
Height of the title bar (px).
WINDOW_RADIUS
Rounded corners of the window while it floats (px).

Functions§

frame_rounded
Whether the window draws its own rounded frame: client-side decorations on a floating window (square when maximised, full screen or tiled).
resize_edge
The edge a press at p (window px) resizes, within RESIZE_BAND of a size window’s edge.

Type Aliases§

SectionBody
Draws a Settings section’s body.
StatusItems
Draws the app’s readings in the status bar.