gfx/lookandfeel_versions.h
LookAndFeel_V1, V2, V3 and V4: the reference's four generations of default appearance, so a port can keep the face it had.
#include <sonore/gfx/lookandfeel_versions.h>- 4types
- Guides: The native editor
On this page
Design notes
Why four old looks are worth carrying
A plugin being moved onto this SDK from the reference has users who know what it looks like. Its screenshots are in a manual, its knobs are in a video tutorial, and a port that changed every control's appearance on the same day it changed the framework underneath would be reported as broken by the people who rely on it most. Most such plugins never chose a look -- they shipped whichever default their framework version had -- so the faithful port is "the default it had", and there were four.
What each one is
V1- the original: grey, rectangular, bevelled. Light top-left edges and dark bottom-right ones, pressed controls with the bevel inverted, a pie-segment knob and a block thumb on a sunken groove.
V2- the glossy one: lavender "glass" lozenge buttons with a highlight over the top half, sphere-shaped slider thumbs on a shadowed groove, a ring segment knob, white popups with a deep-blue highlight.
V3- V2 flattened: the same palette family with the gloss taken off -- square-ish buttons with a faint gradient, thin translucent scroll thumbs, flat tabs.
V4- the colour-scheme look: everything drawn from nine named colours, in the four schemes the reference ships -- dark, midnight, grey and light -- with arc knobs, round thumbs on line tracks and pill scroll thumbs.
The colours are the reference's own where its constructors give them (the V4 schemes are its nine-colour tables verbatim; V1/V2's lavender 0xbbbbff, popup and tooltip colours likewise). The SHAPES are drawn through this SDK's LookAndFeel virtuals with its own rasteriser, so they are faithful in form -- bevel, gloss, flatness, arcs -- rather than pixel-identical to a renderer this SDK does not have.
How a port picks one
static LookAndFeel_V4 look(LookAndFeel_V4::getMidnightColourScheme()); editor.setLookAndFeel(&look); // every widget inside inherits it
Each is an ordinary LookAndFeel subclass, so a port that customised its look derives from the version it customised and overrides the same few methods it did before.
Types 4
class LookAndFeel_V1 : public LookAndFeel
The reference's first default look: grey, rectangular and bevelled, with pressed controls sunken and a pie-segment knob. Same name as the reference's class, for a port that wants to keep this face; the file comment describes all four versions and how to pick one.
Stateless, so one static instance can serve every widget; like any LookAndFeel it must outlive the widgets it is set on.
class LookAndFeel_V2 : public LookAndFeel
The reference's second default look: lavender glass lozenge buttons with a highlight over their top half, sphere-shaped thumbs on a shadowed groove, and white popups with a deep-blue highlight. Same name as the reference's class; see the file comment for the four versions.
Stateless, and the base of LookAndFeel_V3. Like any LookAndFeel it must outlive the widgets it is set on.
class LookAndFeel_V3 : public LookAndFeel_V2
The reference's third default look: V2 flattened -- square-ish buttons with a faint gradient, thin translucent scroll thumbs, flat tabs and bars. Same name as the reference's class, and derived from LookAndFeel_V2 as the reference's is, so what V3 does not redraw it draws as V2.
Stateless. Like any LookAndFeel it must outlive the widgets it is set on.
class LookAndFeel_V4 : public LookAndFeel
The reference's fourth default look: every control drawn from a nine-colour ColourScheme, with arc knobs, round thumbs on line tracks and pill scroll thumbs. Same name as the reference's class, and the same four schemes (dark, the default, then midnight, grey and light), verbatim.
The scheme is the one piece of state: change it with setColourScheme, or through the reference held by getCurrentColourScheme, then repaint the editor -- nothing is told it changed. Like any LookAndFeel it must outlive the widgets it is set on, and is used on the message thread.