Search guides and the APICtrl K
  1. API reference
  2. Native GUI

gfx/concertina.h

Stacked sections that open and close.

#include <sonore/gfx/concertina.h>
On this page

Design notes

What it is for

A plugin with forty parameters. Shown as forty rows it is a wall, and the four the user came for are somewhere in the middle of it. Shown as five sections -- Oscillator, Filter, Envelope, Effects, Output -- four of them closed, it is the one they wanted and a list of where the rest live.

The parameters already carry their group: ParamInfo::group exists and every wrapper reports it, so a host's OWN generic panel groups them. Our editor was the only thing showing the flat wall.

Heights, and why they animate

A section snapping open moves everything below it instantly, and the user has to re-find where they were looking. The same movement over 150 milliseconds is followed by the eye without effort. This is one of the few places an animation is not decoration -- it is what keeps the reader's place.

Through the ValueAnimator, so the clock stays an argument and the layout is exactly testable at any point in the transition.

One open at a time, or several

Both, because both are right for different editors. A synth wants several open; a settings panel wants one. setMaximumOpen decides, and the default is several -- a plugin whose sections fight each other is the surprising one.

Types 1

class ConcertinaPanel : public Widget

Titled sections stacked vertically, each opening and closing under its header -- the reference's ConcertinaPanel. The file comment says why the heights animate and why several may be open by default.

Section contents are NOT owned and must outlive the panel. The panel has no clock: whoever owns it calls setInputClock(now) and tick(now) on every frame. Without tick an animated section never finishes opening; without setInputClock a click animates from time zero and jumps. preferredHeight() changes during a transition, so a panel inside a Viewport wants its size updated from the same tick. Message thread only.

↑↓ to move↵ to openEvery public name in the headers, and every guide