spacr.qt.widgets.picture_settings_dialog¶
Picture-rendering controls shared by cell and image views.
Defaults come from spacr.settings.set_annotate_default_settings(), and
mode applicability comes from spacr.picture_settings. The dialog thus
uses the same values and availability rules as non-GUI callers.
Classes¶
Edit picture settings while retaining mode-inapplicable values. |
Functions¶
|
Return typed defaults for every setting offered by the dialog. |
Module Contents¶
- class spacr.qt.widgets.picture_settings_dialog.PictureSettingsDialog(values: Dict[str, Any] | None = None, mode: str = 'png', parent: PySide6.QtWidgets.QWidget | None = None, *, source: Any = None, objects: Any = None)[source]¶
Bases:
PySide6.QtWidgets.QDialogEdit picture settings while retaining mode-inapplicable values.
- Parameters:
values – the settings to open with. Keys outside the picture vocabulary are IGNORED rather than carried, and keys the dialog knows but the current mode does not apply are kept untouched – which is what “retaining” in the summary above means, and why editing PNG settings does not silently drop the array ones.
mode – which crop SOURCE the pictures come from. It decides which settings apply – a plane index means something to the array route and nothing to the database route, which finds its rows by coordinate columns – so an inapplicable setting is greyed with a reason rather than hidden.
parent – parent widget.
source – where the pictures come from, for the previews.
objects – the objects available to crop, for the previews.
Build the dialog controlling how object crops are drawn.
The cap label’s help is kept without its cost sentence, so re-stating the cost replaces it rather than stacking another copy on the end.
- Parameters:
values – the settings to open with; missing keys fall back to the shipped picture defaults.
mode – which output the settings are for.
parent – parent widget, or
None.source – the data source, used to gate what this mode can offer.
objects – the object types available, for the per-object controls.
- set_mode(mode: str) None[source]¶
Update control availability for an image-source mode.
Inapplicable controls remain visible and explain why they are disabled, so switching modes does not hide or discard configured values.
- Parameters:
mode – image-source mode; each control is enabled or disabled by
spacr.picture_settings.applies_to()for it, and an empty value means"png".
- show_tab(title: str) bool[source]¶
Bring the tab named
titleto the front. False if there is none.A caller that wants one question answered can open the panel on it rather than on whichever tab happened to be first.
- Parameters:
title – tab title, converted with
str()and matched exactly.