spacr.qt.widgets.tile¶
Home-screen tile widgets.
Two variants:
TileClassic square tile with an icon centred above a caption. Kept for compatibility with older screens that consume it.
HTileHorizontal card — icon on the LEFT, name on top, one-line description underneath. Minimalist look inspired by iOS Settings and the VS Code command palette. This is what the startup screen uses by default.
Both emit clicked() when pressed.
Classes¶
Module Contents¶
- class spacr.qt.widgets.tile.HTile(text: str, description: str = '', icon: PySide6.QtGui.QIcon | None = None, icon_size: int = 52, parent=None)[source]¶
Bases:
PySide6.QtWidgets.QPushButtonHorizontal card: icon left, name + description right.
Renders as a full-width row inside a two- or three-column grid. Uses
font-family: "Open Sans"(Regular for the name, Light for the description) and a subtle background that only appears on hover — nothing to distract until you know what you want.- Parameters:
text – primary label (e.g. app name).
description – single-line subtitle (e.g. app tagline).
icon – QIcon rendered on the left.
icon_size – icon side length in px.
parent – parent widget; ownership only.
- Variables:
clicked – emitted when the tile is pressed.
Build a wide tile: an icon beside its label and description.
- Parameters:
text – the label.
description – the sentence beside it.
icon – the picture;
Noneleaves the tile text-only.icon_size – the icon’s edge, in pixels.
parent – parent widget, or
None.
- minimumSizeHint() PySide6.QtCore.QSize[source]¶
Stay shrinkable — the name elides when a caller caps the width.
- required_width() int[source]¶
Width in px at which this tile shows its whole name.
Layout margins (which already reserve room for the icon) plus the advance of the full name, with a 2 px guard for the sub-pixel rounding QLabel does when it lays the text out.
- sizeHint() PySide6.QtCore.QSize[source]¶
Report the width the name actually needs, not just the icon’s.
- property name_label: spacr.qt.widgets.eliding.ElidingLabel[source]¶
The label that renders the tile’s name.
- class spacr.qt.widgets.tile.Tile(text: str, icon: PySide6.QtGui.QIcon | None = None, icon_size: int = 64, tile_size: int = 120, caption: str = '', parent=None)[source]¶
Bases:
PySide6.QtWidgets.QWidgetLarge square tile with an icon and a caption underneath.
Kept for older screens. New home-screen code uses
HTile.- Parameters:
text – fallback label (also used to derive initials if no icon).
icon – optional QIcon to render inside the tile.
icon_size – base icon side length in px; animates on hover.
tile_size – fixed side length of the tile button in px.
caption – caption shown under the tile; defaults to
text.parent – parent widget; ownership only.
- Variables:
clicked – emitted when the tile button is pressed.
Build a square tile: an icon over its label.
- Parameters:
text – the label.
icon – the picture;
Noneleaves the tile text-only.icon_size – the icon’s edge, in pixels.
tile_size – the tile’s edge, in pixels.
caption – a second line under the label.
parent – parent widget, or
None.