fix(instrument-ui): raise Disabled-cue contrast, fix stale 1.2 MASTER row, close hover/focus minors
This commit is contained in:
@@ -37,7 +37,9 @@ void ReaSamplerEditor::onMouseDown(int x, int y) {
|
||||
// The overlay focus follows the deck (mouseDownDeck sets it), and clicking a control
|
||||
// surface OUTSIDE the envelope decks clears it. The waveform band is deliberately not one
|
||||
// of those surfaces: it IS the overlay, so editing what you selected must not deselect it.
|
||||
if (drag_ == DragKind::kNone && contains(fl.bands.chrome, x, y) &&
|
||||
// Chrome's own dead space (the title band, the gaps between its controls) is not a control
|
||||
// surface either — hoverChrome answers only for chrome's actual interactive elements.
|
||||
if (drag_ == DragKind::kNone && hoverChrome(fl, x, y).kind != HoverKind::kNone &&
|
||||
overlayEnv_ != OverlayEnv::kNone) {
|
||||
overlayEnv_ = OverlayEnv::kNone;
|
||||
invalidate(); // the chrome branches below repaint only what THEY changed
|
||||
|
||||
@@ -32,9 +32,11 @@ bool ReaSamplerEditor::mouseDownDeck(const FaceLayout& fl, int x, int y) {
|
||||
// The deck IS the overlay's click target: anywhere inside an envelope group — panel
|
||||
// background, knob or button — focuses that envelope, and any other group clears it. Set
|
||||
// BEFORE the kind switch and it consumes nothing, so every grab and commit below still
|
||||
// runs. A drag in flight owns the surface, so it refuses the change.
|
||||
// Repaints HERE rather than leaning on the branches below: a click on a group's bare
|
||||
// padding, or on an inert knob, changes the focus and reaches no other invalidate.
|
||||
// runs. A drag in flight owns the surface, so it refuses the change — always true at this
|
||||
// call site today (mouse capture makes a real WM_LBUTTONDOWN-while-dragging unreachable;
|
||||
// WM_CAPTURECHANGED and WM_LBUTTONUP both reset drag_ before another down can land), but
|
||||
// left explicit rather than assumed so a future capture-handling change fails loud, not
|
||||
// by silently letting a drag's own surface steal its own focus mid-gesture.
|
||||
if (drag_ == DragKind::kNone) {
|
||||
const OverlayEnv focus = overlayEnvForGroup(hit.group);
|
||||
if (focus != overlayEnv_) {
|
||||
|
||||
@@ -230,9 +230,11 @@ void ReaSamplerEditor::paintChrome(LICE_IBitmap* bmp, const FaceLayout& fl, bool
|
||||
// its own mark, not just a slightly-quieter fill, so it draws the one outline this
|
||||
// control ever gets. See PLAN.md's Off-vs-Disabled ruling: Off is live and
|
||||
// clickable, Disabled is not, and the two must not read as the same thing.
|
||||
// Outlined in text/dim rather than line/hairline: hairline over this fill composites
|
||||
// to ~1.36:1, under the 3:1 state-indicator floor; text/dim clears it at ~5:1.
|
||||
if (disabled) {
|
||||
LICE_DrawRect(bmp, r.x, r.y, r.width - 1, r.height - 1,
|
||||
toLice(roleColor(Role::LineHairline)), 1.0f, 0);
|
||||
toLice(roleColor(Role::TextDim)), 1.0f, 0);
|
||||
}
|
||||
kitTextCentered(bmp, r, label, kToolbarFont,
|
||||
active && !disabled ? Role::BgBase
|
||||
|
||||
@@ -145,11 +145,15 @@ void ReaSamplerEditor::paintDeck(LICE_IBitmap* bmp, const FaceLayout& fl) {
|
||||
const auto drawButtonToggle = [&](const DeckToggleLayout& t, const char* label, bool active,
|
||||
bool disabled) {
|
||||
const bool hov = !disabled && isHovered(HoverKind::kControl, t.id);
|
||||
// Hover outranks Active here (the reverse of the old order) so an enabled button still
|
||||
// gets a hover cue — same gap drawModeToggle's comment above explains, just on the
|
||||
// ENABLE form's own base role: mixing toward accent/hot FROM accent/primary (rather
|
||||
// than bg/cell) is what makes the already-lit button visibly brighten on hover.
|
||||
const InteractionState st =
|
||||
disabled ? InteractionState::Disabled
|
||||
: (active ? InteractionState::Active
|
||||
: (hov ? InteractionState::Hover : InteractionState::Rest));
|
||||
fillSurface(bmp, toKitBox(t.seg0), Role::BgCell, st);
|
||||
: (hov ? InteractionState::Hover
|
||||
: (active ? InteractionState::Active : InteractionState::Rest));
|
||||
fillSurface(bmp, toKitBox(t.seg0), active ? Role::AccentPrimary : Role::BgCell, st);
|
||||
kitTextCentered(bmp, t.seg0, label, Font::Micro,
|
||||
active && !disabled ? Role::BgBase
|
||||
: (hov ? Role::TextPrimary : Role::TextDim));
|
||||
|
||||
Reference in New Issue
Block a user