spacr.qt.module_hints

Module descriptions go to the hint strip, not over the grid and not into the status bar.

A module description is shown in ONE place – the hint strip along the bottom of the page – and never as a popup over the grid.

The status bar is not used: this filter wrote the description there on every hover and Qt restored the permanent message four seconds later, so the text alternated. The strip holds the last module for thirty seconds and is replaced only by the next one.

Home already worked this way, for the reason given on AppTile: the descriptions run to several hundred characters, and a popup of that size covers the grid the user is choosing from.

The hook is QEvent.ToolTip rather than hover. It fires exactly when Qt has decided to show a tooltip – after the same delay, at the same moment – so the description appears when the user expects it, and returning True from the filter is what stops the popup being drawn. Reimplementing the timing on HoverEnter would be a second, slightly different delay for the same gesture.

Accessible names and descriptions are untouched: they are set separately on these widgets and are what a screen reader reads, so moving the visible text costs no assistive text.

Functions

install_module_hints(→ Optional[_ModuleHints])

Send module descriptions to window's bottom hint strip.

module_hint_text(→ str)

The line a module widget contributes, or "".

Module Contents

spacr.qt.module_hints.install_module_hints(window) → _ModuleHints | None[source]

Send module descriptions to window’s bottom hint strip.

Installed on the APPLICATION rather than on each button: the fold strip builds its buttons lazily, per host masthead, and a filter installed per widget would miss every one made after this ran.

Parameters:

window – the main window; it parents the filter, and its _show_module_hint(key) method is called to show each hovered module’s hint.

Returns:

the filter, so a caller can remove it; None when there is no application to install it on.

spacr.qt.module_hints.module_hint_text(widget: PySide6.QtWidgets.QWidget) → str[source]

The line a module widget contributes, or "".

Name and summary are read from PROPERTIES rather than from the tooltip, so the text is the canonical English source and a language switch retranslates it rather than translating a translation.

Parameters:

widget – the hovered widget; its module name and summary Qt properties are read. None or a deleted widget gives "", and a line longer than MAX_HINT_CHARS is cut at a word with an ellipsis.