crates/veilvoice-gui/src/settings.rs
veilvoice-gui · 1434 lines · read the source here · or on GitHub
The settings panel: a menu of pages, each a titled group of choices.
Why a menu rather than one long list
There are three kinds of setting here and they answer different questions: what the app looks like, how it moves, and what it does with the files it writes. Stacked in one column they read as an undifferentiated wall of tick boxes, and the one that matters most -- at-rest encryption -- ends up looking exactly as important as the colour scheme. A menu with a page per group keeps each question next to its own explanation.
Every change applies immediately, and is saved immediately
There is no "apply" button and no "unsaved changes" state. Both are ways to lose a choice silently. If saving fails the choice still applies for this session and the panel says, in the panel, that it could not be remembered and why -- rather than failing quietly and letting the setting reappear wrong on the next launch.
What is deliberately not in here
The app lock and the at-rest passphrase have their own tab and stay there. A password field sitting between "animations" and "colour scheme" invites being treated with the same weight, and it is not the same weight.
In plain words
The settings, arranged as a short menu rather than one long list.
There are enough of them now that a single column meant scrolling past things you were not looking for, and finding a setting is most of what anybody does in a settings screen.
Each page is a titled group with a sentence saying what it covers, and every choice applies as you make it and is remembered.
WHAT THIS FILE CONTAINS
1434 lines defining 43 functions (33 public), 2 types and 1 constant. Everything below is read out of the source, so it cannot disagree with the code.
The types it owns.
enum Pageline 46 · Which page of the settings menu is showing.struct Settingsline 71 · The settings tab's own state.
What happens when it runs. These are the ways in: public, and nothing else in this file calls them, so they are what an outside caller reaches first.
Settings::loadline 121 · Load preferences from this platform's config directory and apply the chosen theme to ctx.Settings::needs_first_runline 154 · Whether the first-run choice has still to be made.Settings::save_errorline 180 · Whether the app should open in group mode, and a way to change it.Settings::show_install_tabline 191 · Whether the install tab should be offered at all.Settings::hide_install_tabline 196 · Whether the install tab is hidden by preference.Settings::accelerationline 214 · Whether the window asks the platform for a hardware-drawn context.Settings::show_frame_rateline 243 · Whether the header carries a live frame-rate readout.Settings::always_groupline 248 · Whether the app should open in group mode.Settings::seal_with_app_lockline 277 · Whether every recording is sealed with the app-lock passphrase.Settings::destinationline 282 · The remembered encrypted destination, rebuilt from the settings file.Settings::set_destinationline 291 · Remember a destination, including the answer to the hidden question.
reachespersistSettings::set_always_groupline 350 · Record whether the app should open in group mode.
reachespersistSettings::set_seal_with_app_lockline 364 · Remember, or stop remembering, that recordings are sealed with the app-lock passphrase.
reachespersistSettings::toured_tabsline 579 · The tabs the tour has already covered.Settings::mark_touredline 590 · Record that the tour has covered these tabs, and save.
reachespersistSettings::first_run_appearanceline 604 · The first-run panel: offered once, with animation already on.
reachespersistSettings::first_run_autolockline 631 · The autolock switch and delay, for the first-run setup to place.
reachespersistSettings::finish_first_runline 659 · Mark the first run answered.
reachespersistSettings::tabline 666 · The settings tab.
reachesappearance_page,interface_page,motion_page,security_page,storage_page,custom_palette_help,persist,section,swatches,failsafe,live_monitor,notify_styleSettings::theme_pickerline 800 · The colour scheme, as a compact control for the window header.
reachespersist
WHAT CALLS WHAT
The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one. 22 of 43 functions are drawn; the diagram is bounded at 22 so it stays readable.
The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
n_motion["Settings::motion<br/>line 149"]
n_set_hide_install_tab["Settings::set_hide_install_tab<br/>line 201"]
n_set_acceleration["Settings::set_acceleration<br/>line 219"]
n_frame_target["Settings::frame_target<br/>line 228"]
n_set_frame_target["Settings::set_frame_target<br/>line 233"]
n_autolock["Settings::autolock<br/>line 253"]
n_set_autolock["Settings::set_autolock<br/>line 264"]
n_set_destination(["Settings::set_destination<br/>line 291"])
n_failsafe["Settings::failsafe<br/>line 308"]
n_set_failsafe["Settings::set_failsafe<br/>line 313"]
n_notify_style["Settings::notify_style<br/>line 322"]
n_set_notify_style["Settings::set_notify_style<br/>line 327"]
n_live_monitor["Settings::live_monitor<br/>line 336"]
n_set_live_monitor["Settings::set_live_monitor<br/>line 341"]
n_set_always_group(["Settings::set_always_group<br/>line 350"])
n_set_seal_with_app_lock(["Settings::<br/>set_seal_with_app_lock<br/>line 364"])
n_mark_toured(["Settings::mark_toured<br/>line 590"])
n_first_run_appearance(["Settings::first_run_appearance<br/>line 604"])
n_first_run_autolock(["Settings::first_run_autolock<br/>line 631"])
n_finish_first_run(["Settings::finish_first_run<br/>line 659"])
n_tab(["Settings::tab<br/>line 666"])
n_theme_picker(["Settings::theme_picker<br/>line 800"])
n_set_autolock --> n_autolock
n_set_failsafe --> n_failsafe
n_set_live_monitor --> n_live_monitor
n_set_notify_style --> n_notify_style
click n_motion href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L149" "open the source"
click n_set_hide_install_tab href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L201" "open the source"
click n_set_acceleration href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L219" "open the source"
click n_frame_target href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L228" "open the source"
click n_set_frame_target href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L233" "open the source"
click n_autolock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L253" "open the source"
click n_set_autolock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L264" "open the source"
click n_set_destination href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L291" "open the source"
click n_failsafe href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L308" "open the source"
click n_set_failsafe href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L313" "open the source"
click n_notify_style href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L322" "open the source"
click n_set_notify_style href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L327" "open the source"
click n_live_monitor href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L336" "open the source"
click n_set_live_monitor href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L341" "open the source"
click n_set_always_group href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L350" "open the source"
click n_set_seal_with_app_lock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L364" "open the source"
click n_mark_toured href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L590" "open the source"
click n_first_run_appearance href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L604" "open the source"
click n_first_run_autolock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L631" "open the source"
click n_finish_first_run href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L659" "open the source"
click n_tab href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L666" "open the source"
click n_theme_picker href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/settings.rs#L800" "open the source"
classDef entry fill:#1f2335,stroke:#7aa2f7,color:#c0caf5
class n_set_destination,n_set_always_group,n_set_seal_with_app_lock,n_mark_toured,n_first_run_appearance,n_first_run_autolock,n_finish_first_run,n_tab,n_theme_picker entry
classDef api fill:#1f2335,stroke:#7dcfff,color:#c0caf5
class n_motion,n_set_hide_install_tab,n_set_acceleration,n_frame_target,n_set_frame_target,n_autolock,n_set_autolock,n_failsafe,n_set_failsafe,n_notify_style,n_set_notify_style,n_live_monitor,n_set_live_monitor api
This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.
ITEMS
| Item | Line | Documentation |
|---|---|---|
Page pub enum | 46 | Which page of the settings menu is showing. |
Page::ALL pub const | 61 | Every page, in menu order, with its label and one-line summary. |
Settings pub struct | 71 | The settings tab's own state. |
Settings::default fn | 100 | |
Settings::load pub fn | 121 | Load preferences from this platform's config directory and apply the chosen theme to ctx. |
Settings::motion pub fn | 149 | How much movement is allowed this frame. |
Settings::needs_first_run pub fn | 154 | Whether the first-run choice has still to be made. |
Settings::persist fn | 159 | Write the settings out, encrypted and obfuscated as they are at rest. |
Settings::save_error pub fn | 180 | Whether the app should open in group mode, and a way to change it. |
Settings::show_install_tab pub fn | 191 | Whether the install tab should be offered at all. |
Settings::hide_install_tab pub fn | 196 | Whether the install tab is hidden by preference. |
Settings::set_hide_install_tab pub fn | 201 | Record whether to hide the install tab on a portable copy. |
Settings::acceleration pub fn | 214 | Whether the window asks the platform for a hardware-drawn context. |
Settings::set_acceleration pub fn | 219 | Record whether to ask for acceleration. |
Settings::frame_target pub fn | 228 | How often the window draws while something in it is moving. |
Settings::set_frame_target pub fn | 233 | Record a new frame-rate target. |
Settings::show_frame_rate pub fn | 243 | Whether the header carries a live frame-rate readout. |
Settings::always_group pub fn | 248 | Whether the app should open in group mode. |
Settings::autolock pub fn | 253 | How the autolock is configured, brought into range. |
Settings::set_autolock pub fn | 264 | Remember an autolock setting. |
Settings::seal_with_app_lock pub fn | 277 | Whether every recording is sealed with the app-lock passphrase. |
Settings::destination pub fn | 282 | The remembered encrypted destination, rebuilt from the settings file. |
Settings::set_destination pub fn | 291 | Remember a destination, including the answer to the hidden question. |
Settings::failsafe pub fn | 308 | The Failsafe posture in force. |
Settings::set_failsafe pub fn | 313 | Record the Failsafe posture. |
Settings::notify_style pub fn | 322 | How notifications should be shown. |
Settings::set_notify_style pub fn | 327 | Record how notifications should be shown. |
Settings::live_monitor pub fn | 336 | Where the live monitor sits, or whether it is shown. |
Settings::set_live_monitor pub fn | 341 | Record where the live monitor sits. |
Settings::set_always_group pub fn | 350 | Record whether the app should open in group mode. |
Settings::set_seal_with_app_lock pub fn | 364 | Remember, or stop remembering, that recordings are sealed with the app-lock passphrase. |
Settings::interface_page fn | 373 | Which tabs the window offers. |
Settings::toured_tabs pub fn | 579 | The tabs the tour has already covered. |
Settings::mark_toured pub fn | 590 | Record that the tour has covered these tabs, and save. |
Settings::first_run_appearance pub fn | 604 | The first-run panel: offered once, with animation already on. |
Settings::first_run_autolock pub fn | 631 | The autolock switch and delay, for the first-run setup to place. |
Settings::finish_first_run pub fn | 659 | Mark the first run answered. |
Settings::tab pub fn | 666 | The settings tab. |
Settings::custom_palette_help fn | 721 | Explain where custom palettes go, and say what was refused and why. |
Settings::theme_picker pub fn | 800 | The colour scheme, as a compact control for the window header. |
Settings::appearance_page fn | 826 | The appearance page: palette, and what each one changes. |
Settings::motion_page fn | 865 | The motion page, including honouring the system's reduced-motion setting. |
Settings::security_page fn | 1002 | Roadmap item 92. |
Settings::storage_page fn | 1102 | The storage page: where files go, and the portable or installed choice. |
section fn | 1163 | A titled group with a one-line explanation under it. |
swatches fn | 1171 | The active palette, as a row of swatches, so the choice can be seen rather than only read. |