paint::settings

The paint schema, and the one resolver that reads and writes it.

Detailed description

Paint wrote its settings by five routes (config-ui parity-matrix §CFG-M3). They are one route now. The canvas, the stroke parameter grid, the preview widgets, the brush panel and the settings window all read a value with value() and write it with write(), and listen to notifier() for a change from any writer. A canvas does not read a paint key from `app::Settings` itself.

The resolver lives as long as the process. It is not destroyed at exit, so its notifier and its rate limiter cannot outlive the application object by accident.

Function documentation

paintSchema

const config::Schema &settings::paintSchema()

The paint schema: every setting of Paint as data.

The rows replace the Config tab of the brush panel and the five routes that wrote its values (config-ui §CFGC-3, parity rows CFG-50 to CFG-69). Rows CFG-111 to CFG-116 add the engine keys that the worker canvas read from the file, and the opacity of the Areas tab. Every key stays as it was, so a saved value from an earlier run is read as it was written. Paint has one level, the app level in the node's `app::Settings`.

setUpModel

void settings::setUpModel(config::ui::ConfigModel &model, QWidget *window, const QSharedPointer<Settings> &settings)

The model of the paint settings window, with its help opener.

The setup was inline in PaintActivity, which a unit test cannot build without a GPU canvas. It is here, so testPaintSettingsSchema can check that the "Help" link has an opener.

model gets the paint schema, window is where a help page opens, and settings keeps the window state.

In this section