Rebuild the chrome band: full-width piano strip with uniform key widths, note tooltips, one toolbar font

This commit is contained in:
2026-07-30 09:14:07 -04:00
parent ea52b14f2a
commit ae23ee0882
14 changed files with 656 additions and 386 deletions
+11 -10
View File
@@ -1,8 +1,8 @@
#pragma once
// sample_chrome.h — interior geometry of the Sample face's CHROME band: the toolbar row
// (title + Browse) over the control row (root/piano strip, preview trigger, preview-velocity
// knob cell, curve-preview button, Mono|Stereo toggle). Reads the band rect the allocator
// hands it (sample_bands) and never allocates vertical space of its own.
// (title + the whole right-anchored control run + Browse) over the strip row, which the
// piano strip has to itself. Reads the band rect the allocator hands it (sample_bands) and
// never allocates vertical space of its own.
#include "core/instrument/ui/editor_geometry.h" // Rect
@@ -11,21 +11,22 @@ namespace reasampler::instrument::ui {
inline constexpr int kNavButtonWidth = 62; // the Browse toolbar button
// Every interactive rect inside the chrome band, in one pass so draw and hit-test cannot
// derive them differently. The control row's right-anchored run is fixed-width (preview,
// velocity cell, curve button, channel toggle) and the root strip takes the remainder, so
// the strip grows with the window.
// derive them differently. The toolbar's fixed run is right-anchored and the title takes
// what is left of that row; the strip row carries nothing but the strip, so the strip grows
// with the window in both directions.
struct ChromeRects {
Rect toolbar; // full-width top row
Rect navBrowse; // right-anchored in the toolbar
Rect controls; // full-width second row
Rect rootStrip; // remainder-width, left
Rect preview;
Rect title; // the title text slot: the toolbar left of the control run
Rect preview; // ---- the right-anchored run, left to right ----
Rect velCell; // preview-velocity knob cell (knob + label band)
Rect velKnob;
Rect velLabel;
Rect curveBtn; // opens the velocity-curve popup
Rect chanMono;
Rect chanStereo;
Rect navBrowse;
Rect controls; // full-width second row
Rect rootStrip; // the piano strip: the whole row, inset only by the shared band pad
};
// `knobSize` is the deck knob square, passed in so this module does not depend on knob_deck.