Save "Preview theme" state; resolves #13940

See #13940.

Also removed some superfluous whitespace.