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.
IT USED TO GO TO THE STATUS BAR, the line in the bottom LEFT of the window, with a four-second linger, and it flickered: text that looked as though it were going to the hovered module and then to something else and back again. Two writers, not one – this filter put the description there on every hover and Qt put the permanent message back four seconds later, so the corner alternated. The strip does not alternate – it holds the last module for thirty seconds and is replaced only by the next.
Home already worked this way and the reason is written on AppTile:
these blurbs run to several hundred characters, which is fine in a fixed
line the eye can skip and wrong in a box drawn on top of the very grid
you are reading to choose between. The sidebar and the fold strip kept
popping them anyway.
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¶
|
Send module descriptions to |
|
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 status bar.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;
Nonewhen 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.
Noneor a deleted widget gives"", and a line longer thanMAX_HINT_CHARSis cut at a word with an ellipsis.