spacr.qt.widgets.preview_refresh¶
A Refresh button for every live preview: read src again and reload.
The previews load their first field from src once, on their
own. When the folder changes under the same path, or the automatic load
picked nothing because the path was wrong at the time, the user needs a way
to say “look again”. This is that button, one implementation for all of
them, because each preview only differs in the name of its loader.
Functions¶
|
The source path the screen's form holds right now. |
Add a Refresh button to a preview card's title row. |
|
|
Check the screen's src and reload |
Module Contents¶
- spacr.qt.widgets.preview_refresh.current_src(screen: Any) str[source]¶
The source path the screen’s form holds right now.
- Parameters:
screen – the module screen.
- Returns:
the path, or
"".
- spacr.qt.widgets.preview_refresh.install_refresh_button(screen: Any, card: Any, panel: Any, *, panel_getter: Callable[[], Any] | None = None) PySide6.QtWidgets.QToolButton | None[source]¶
Add a Refresh button to a preview card’s title row.
- Parameters:
screen – the module screen.
card – the preview’s
Card.panel – the preview panel it reloads.
panel_getter – asked for the panel at the click instead of
panel, for a card whose panel is built the first time the card is shown and so does not exist when the button does.
- Returns:
the button, or
Nonewhen the card has no title row to take it.