parts¶
Real Qt widgets the thirty Home-screen variants are built from.
Everything here is a genuine widget — the ones that already exist in
spaCR (HTile, Card, Section, Divider, UsageBar,
ElidingLabel, the real Sidebar) are imported and used as-is; the
ones a variant proposes but the app does not have yet (a recent-runs
strip, a resume banner, a guided quick-start, a project status bar, a
what’s-new panel, a big illustrated tile) are built here as minimal but
real widgets, so a layout that wins the review is known-buildable.
No mockups. No painted screenshots.
Attributes¶
Classes¶
A large illustrated launcher tile: icon above name above blurb. |
|
A compact one-line app row: small icon, name, blurb, optional badge. |
|
A QPushButton whose size the app stylesheet cannot take away. |
|
A 1440x900 home-screen canvas with optional window chrome. |
Functions¶
|
A grid of |
|
A category heading: tracked small caps, optional hairline rule. |
|
A left rail of CATEGORIES (not apps) beside a content pane. |
|
A pill-shaped filter chip. |
|
A vertical stack of |
|
Shorten |
|
Stylesheet for the object names this module introduces. |
|
The current home hero: logo + wordmark + one-line pitch. |
|
The sticky bottom hint bar the current home screen ships with. |
|
One of the app's real |
|
A wrapping grid of real |
|
Minimum height an |
|
A keycap chip, e.g. |
|
How many lines |
|
The app's menu bar, as a real (non-interactive) strip. |
|
A rounded surface panel plus its layout. |
|
ADDED: a pinned-favourites row the user curates themselves. |
|
A sentence-case heading (used where small caps read as shouting). |
|
ADDED: which dataset is open, how big it is, what state it is in. |
|
ADDED: what is queued to run next, straight on the home screen. |
|
ADDED: a guided first-run path — three numbered steps with buttons. |
|
The app's actual |
|
ADDED: the same history as a narrow vertical list. |
|
ADDED: the last few runs as resumable cards. |
|
ADDED: "pick up where you left off" — the single biggest button. |
|
Wrap a widget in a frameless scroll area (vertical by default). |
|
A real search field (the search-first variants' entry point). |
|
ADDED: one prominent "start a run" path — folder, pipeline, Run. |
|
ADDED: a row of big-number tiles (runs, plates, objects, models). |
|
The app's status bar: transient message left, app + version right. |
|
ADDED: disk + GPU state, built on the real |
|
A plain styled label (no wrapping, sized to its own text). |
|
A slim brand bar: logo mark + title (+ subtitle) + right actions. |
|
A bare container widget plus its layout (background transparent). |
|
ADDED: what changed in this version, so an upgrade is discoverable. |
|
A word-wrapped label with a guaranteed line budget. |
Module Contents¶
- class parts.BigTile(ctx: common.Ctx, key: str, *, width: int, height: int, icon_px: int = 56, blurb_lines: int = 0, accent: bool = False, badge: str = '')[source]¶
Bases:
FixedButtonA large illustrated launcher tile: icon above name above blurb.
Does not exist in spaCR today — this is the widget the “large illustrated tiles” variants propose, built for real so the layout can be judged on how it actually renders.
- class parts.DenseRow(ctx: common.Ctx, key: str, *, width: int, name_width: int = 136, icon_px: int = 20, show_blurb: bool = True, badge: str = '', shortcut: str = '')[source]¶
Bases:
PySide6.QtWidgets.QPushButtonA compact one-line app row: small icon, name, blurb, optional badge.
The “dense list” answer to the tile grid — many more apps above the fold, at the cost of the tile’s visual weight.
- class parts.FixedButton(width: int, height: int, parent=None)[source]¶
Bases:
PySide6.QtWidgets.QPushButtonA QPushButton whose size the app stylesheet cannot take away.
setFixedSizealone is not enough here: the app QSS carriesQPushButton { min-height: 22px }, andQStyleSheetStylere-applies that rule’s geometry to the widget on polish, wiping the minimum asetFixedSizehad set. The layout then reads a 40 px minimum and squashes a 116 px tile to 48 px — which is exactly the kind of silent clipping these renders exist to catch. Reporting the size throughsizeHint/minimumSizeHintsurvives the restyle.- minimumSizeHint() PySide6.QtCore.QSize[source]¶
Same as
sizeHint()— the tile does not shrink.
- class parts.Page(ctx: common.Ctx, *, chrome: bool = True, margins: Tuple[int, int, int, int] = (28, 22, 28, 18), spacing: int = 16)[source]¶
Bases:
PySide6.QtWidgets.QWidgetA 1440x900 home-screen canvas with optional window chrome.
- Parameters:
ctx – the theme context.
chrome – draw the app’s menu strip + status bar, so the space a variant actually gets on a 1440x900 laptop is what is rendered.
margins – content margins of the body area.
- add_aside(aside: PySide6.QtWidgets.QWidget) None[source]¶
Insert a column to the right of the content area.
- add_rail(rail: PySide6.QtWidgets.QWidget) None[source]¶
Insert a navigation rail to the left of the content area.
- parts.big_tile_grid(ctx: common.Ctx, keys: Sequence[str], *, cols: int, width: int, height: int, icon_px: int = 56, blurb_lines: int = 0, hspace: int = 10, vspace: int = 10, badges: dict | None = None) PySide6.QtWidgets.QWidget[source]¶
A grid of
BigTile.
- parts.cat_header(ctx: common.Ctx, text: str, *, rule: bool = True, note: str = '', size: int = 11) PySide6.QtWidgets.QWidget[source]¶
A category heading: tracked small caps, optional hairline rule.
- parts.cat_rail(ctx: common.Ctx, titles: Sequence[str], *, selected: int = 0, width: int = 232, header: str = '', counts: Sequence[int] | None = None) PySide6.QtWidgets.QWidget[source]¶
A left rail of CATEGORIES (not apps) beside a content pane.
- parts.chip(ctx: common.Ctx, text: str, on: bool = False) PySide6.QtWidgets.QPushButton[source]¶
A pill-shaped filter chip.
- parts.dense_list(ctx: common.Ctx, keys: Sequence[str], *, width: int, name_width: int = 136, show_blurb: bool = True, badges: dict | None = None, shortcuts: dict | None = None, spacing: int = 1) PySide6.QtWidgets.QWidget[source]¶
A vertical stack of
DenseRow.
- parts.elide_to_lines(text: str, font: PySide6.QtGui.QFont, width: int, lines: int) str[source]¶
Shorten
textso it lays out in at mostlinesatwidthpx.Uses
QTextLayout— the same line breaker QLabel uses — so the answer is exact rather than a character-count guess. Text clipping is the exact defect the home-screen rework was raised to fix, so every wrapped blurb in these variants goes through here.
- parts.extra_qss(ctx: common.Ctx) str[source]¶
Stylesheet for the object names this module introduces.
- parts.hero(ctx: common.Ctx, *, compact: bool = False) PySide6.QtWidgets.QWidget[source]¶
The current home hero: logo + wordmark + one-line pitch.
- parts.hint_bar(ctx: common.Ctx, text: str = 'Hover a tile to see what it does.') PySide6.QtWidgets.QLabel[source]¶
The sticky bottom hint bar the current home screen ships with.
- parts.htile(ctx: common.Ctx, key: str, *, width: int, height: int = 0, icon_px: int = 44, name_px: int = 0) PySide6.QtWidgets.QWidget[source]¶
One of the app’s real
HTilecards, at a fixed width.- Parameters:
name_px – override the tile name’s font size. The shipped tile draws it at the 17 px “subtitle” size, which is what forces a 255 px minimum width and therefore at most five columns on a 1440 px screen; the compact variants restyle that one label.
- parts.htile_grid(ctx: common.Ctx, keys: Sequence[str], *, cols: int, width: int, hspace: int = 8, vspace: int = 8, icon_px: int = 44, height: int = 0, name_px: int = 0) PySide6.QtWidgets.QWidget[source]¶
A wrapping grid of real
HTilecards.
- parts.htile_height(icon_px: int) int[source]¶
Minimum height an
HTileneeds so its icon is not cropped.
- parts.kbd(ctx: common.Ctx, text: str) PySide6.QtWidgets.QLabel[source]¶
A keycap chip, e.g.
Ctrl+1.
- parts.line_count(text: str, font: PySide6.QtGui.QFont, width: int) int[source]¶
How many lines
textoccupies when wrapped atwidthpx.
The app’s menu bar, as a real (non-interactive) strip.
- parts.panel(ctx: common.Ctx, *, accent: bool = False, plain: bool = False, margins=(14, 12, 14, 12), spacing: int = 8, horizontal=False)[source]¶
A rounded surface panel plus its layout.
- parts.pinned_row(ctx: common.Ctx, keys: Sequence[str] = (), *, tile_w: int = 150, tile_h: int = 108) PySide6.QtWidgets.QWidget[source]¶
ADDED: a pinned-favourites row the user curates themselves.
- parts.plain_header(ctx: common.Ctx, text: str, note: str = '') PySide6.QtWidgets.QWidget[source]¶
A sentence-case heading (used where small caps read as shouting).
- parts.project_status_strip(ctx: common.Ctx) PySide6.QtWidgets.QWidget[source]¶
ADDED: which dataset is open, how big it is, what state it is in.
- parts.queue_panel(ctx: common.Ctx, *, width: int = 320) PySide6.QtWidgets.QWidget[source]¶
ADDED: what is queued to run next, straight on the home screen.
- parts.quick_start(ctx: common.Ctx, *, width: int = 0, steps: Sequence[Tuple[str, str, str]] = ()) PySide6.QtWidgets.QWidget[source]¶
ADDED: a guided first-run path — three numbered steps with buttons.
- parts.real_sidebar(ctx: common.Ctx) PySide6.QtWidgets.QWidget[source]¶
The app’s actual
Sidebarwidget, unmodified.Used by the baseline variant so the render shows exactly what a 1440x900 laptop gets today — including the fact that one row per registered app plus five section headings does not fit in 900 px, so the bottom of the list is simply not reachable.
- parts.recent_runs_list(ctx: common.Ctx, *, count: int = 4, width: int = 320) PySide6.QtWidgets.QWidget[source]¶
ADDED: the same history as a narrow vertical list.
- parts.recent_runs_strip(ctx: common.Ctx, *, count: int = 3, card_width: int = 300, height: int = 92) PySide6.QtWidgets.QWidget[source]¶
ADDED: the last few runs as resumable cards.
- parts.resume_banner(ctx: common.Ctx, *, width: int = 0) PySide6.QtWidgets.QWidget[source]¶
ADDED: “pick up where you left off” — the single biggest button.
Names the last run and offers to resume it, open its output, or start the next stage.
- parts.scroll_area(inner: PySide6.QtWidgets.QWidget, *, horizontal: bool = False) PySide6.QtWidgets.QScrollArea[source]¶
Wrap a widget in a frameless scroll area (vertical by default).
- parts.search_box(ctx: common.Ctx, placeholder: str, *, big: bool = False, width: int = 0) PySide6.QtWidgets.QLineEdit[source]¶
A real search field (the search-first variants’ entry point).
- parts.start_run_panel(ctx: common.Ctx, *, width: int = 0, height: int = 210) PySide6.QtWidgets.QWidget[source]¶
ADDED: one prominent “start a run” path — folder, pipeline, Run.
- parts.stat_row(ctx: common.Ctx, stats: Sequence[Tuple[str, str]], *, height: int = 74) PySide6.QtWidgets.QWidget[source]¶
ADDED: a row of big-number tiles (runs, plates, objects, models).
- parts.status_bar(ctx: common.Ctx, message: str = 'Ready') PySide6.QtWidgets.QWidget[source]¶
The app’s status bar: transient message left, app + version right.
- parts.system_panel(ctx: common.Ctx, *, width: int = 300, title: str = 'System') PySide6.QtWidgets.QWidget[source]¶
ADDED: disk + GPU state, built on the real
UsageBarwidget.
- parts.text_label(ctx: common.Ctx, text: str, *, size: int = 13, weight: int = 400, color: str | None = None, tracking: str = '0px', upper: bool = False) PySide6.QtWidgets.QLabel[source]¶
A plain styled label (no wrapping, sized to its own text).
- parts.top_bar(ctx: common.Ctx, *, title: str = 'spaCR', subtitle: str = '', actions: Sequence[Tuple[str, bool]] = ()) PySide6.QtWidgets.QWidget[source]¶
A slim brand bar: logo mark + title (+ subtitle) + right actions.
- Parameters:
actions –
(label, primary)pairs rendered right-aligned.
- parts.transparent(spacing: int = 0, margins=(0, 0, 0, 0), horizontal=False)[source]¶
A bare container widget plus its layout (background transparent).
- parts.whats_new_panel(ctx: common.Ctx, *, width: int = 320, items: int = 4) PySide6.QtWidgets.QWidget[source]¶
ADDED: what changed in this version, so an upgrade is discoverable.
- parts.wrapped(ctx: common.Ctx, text: str, width: int, lines: int, *, color: str | None = None, size: int = 12, weight: int = 300, reserve: bool = False) PySide6.QtWidgets.QLabel[source]¶
A word-wrapped label with a guaranteed line budget.
linesis a ceiling: longer text is elided to fit it, and the label is then sized to the lines it actually uses, so a one-line string in a three-line budget does not leave a hole. Passreserve=Truewhere a fixed height matters (grid cells that must line up).