visualdynamics.gui.preferences¶
preferences
¶
What the application remembers between launches: the appearance, and whether the plots read in 3-D.
One QSettings under one name, so a preference set on one launch is
read on the next; the tests point the store at a temporary folder
through QSettings.setPath, so nothing a test chooses reaches the
user's own file.
The appearance a window wears is decided in this order, and the order
is the point: an explicit statement for this launch
(VISUALDYNAMICS_THEME, which --theme sets) beats the remembered
choice, and the remembered choice beats what the platform reports —
'system' means follow the platform, which is the default and what
theme.system_scheme answers.
Functions:
| Name | Description |
|---|---|
settings |
The application's own store: the platform's (a plist on macOS, |
remembered_appearance |
'system', 'light' or 'dark' — 'system' when nothing was chosen |
remember_appearance |
Store the choice; 'system' clears it rather than storing a word |
remembered_3d |
Whether the plots open in 3-D: True, the default (Brandon's |
remember_3d |
Store the 2D/3D choice. |
remembered_creator |
The name an exported ESCDF file records as its creator |
remember_creator |
Store the creator name. |
chosen_scheme |
The theme to wear now: this launch's statement, else the |
wear_appearance |
Make the whole application wear the chosen appearance — the |
refresh_palettes |
Make every widget re-read the application palette. |
Functions:¶
settings
¶
The application's own store: the platform's (a plist on macOS,
the registry on Windows, a file under ~/.config on Linux), or the
file VISUALDYNAMICS_SETTINGS names.
Source code in src/visualdynamics/gui/preferences.py
remembered_appearance
¶
'system', 'light' or 'dark' — 'system' when nothing was chosen or the stored word is not one of ours.
Source code in src/visualdynamics/gui/preferences.py
remember_appearance
¶
Store the choice; 'system' clears it rather than storing a word that means "nothing chosen".
Source code in src/visualdynamics/gui/preferences.py
remembered_3d
¶
Whether the plots open in 3-D: True, the default (Brandon's call), until the toggle was last left on 2-D (Brandon, 2026-09-28: the choice persists across the MAC and across launches).
Source code in src/visualdynamics/gui/preferences.py
remember_3d
¶
remembered_creator
¶
The name an exported ESCDF file records as its creator (File → Creator Name…), '' when none was set: the writer then records the login name rather than asking, since a file format library must never prompt (2026-09-30).
Source code in src/visualdynamics/gui/preferences.py
remember_creator
¶
chosen_scheme
¶
The theme to wear now: this launch's statement, else the remembered choice, else the platform's.
Source code in src/visualdynamics/gui/preferences.py
wear_appearance
¶
Make the whole application wear the chosen appearance — the window chrome, the menus, every native widget — not only the parts this program draws itself.
Qt 6.8 gave QStyleHints.setColorScheme: Light or Dark forces the
application's appearance (on macOS, the NSApp appearance), Unknown
follows the platform again. Without it the first cut of the menu
changed the plots and the scene and left the chrome as the OS had
it, and Brandon chose Light and saw nothing change (2026-09-14).
The platform then reports the forced scheme, which is what
theme.system_scheme and the colorSchemeChanged slot read, so
every later repaint agrees. choice defaults to what
chosen_scheme would answer: this launch's statement, else the
remembered choice, else the platform's.
refresh also makes every widget already built re-read the palette
(refresh_palettes) — what a switch of appearance needs. A window
being built passes False: its widgets read the palette as they are
made, and walking every other top-level widget from its constructor
reached windows and web views from before that were closed and
waiting to be deleted — a segmentation fault in refresh_palettes
on a CI runner (2026-09-27, the Python 3.12 job after public #62).
Source code in src/visualdynamics/gui/preferences.py
refresh_palettes
¶
Make every widget re-read the application palette.
On macOS with Qt 6.11 the application palette follows a color
scheme change at once, but widgets already on screen keep the
palette they resolved before it — the status bar and the panes
stayed light after Brandon switched back to Dark (his screenshot,
2026-09-14), while a fresh window came up right. Setting an
empty palette on a widget makes it resolve from its parent and
the application again, and leaves WA_SetPalette clear, so the
widgets that own a palette on purpose (the tree and the tables,
colored by the theme) are skipped and keep theirs.