fix(bank_panel): add CAPTURE_BATCH_RAZOR button, unify toLice conversion, use palette role for action-bar divider

This commit is contained in:
2026-07-26 20:59:22 -04:00
parent 54f37be0bb
commit 47223dfb3e
+13 -15
View File
@@ -495,11 +495,8 @@ KitBox toKitBox(const RECT& r) {
return KitBox{r.left, r.top, r.right - r.left, r.bottom - r.top};
}
// KitColor -> LICE_pixel at the panel's own boundary. draw_kit::toLice is now declared in
// draw_kit.h and used for the four drawThumbnail sites above. This local alias is kept for
// the remaining raw LICE_DrawRect/LICE_Line borders the panel draws over kit surfaces
// (dividers, drop-target highlights, segment/tab hairlines) so those pick up palette roles.
LICE_pixel toLicePixel(const KitColor& c) { return LICE_RGBA(c.r, c.g, c.b, c.a); }
// KitColor -> LICE_pixel: all sites use the kit's toLice() from draw_kit.h — the single
// conversion boundary the kit enforces. No local alias needed.
// L2 role/font-aware text: draws through the kit in a palette ROLE color and a chosen kit
// Font (the action bar uses Micro for the keybinding sub-label, Label for the name, Title for
@@ -546,7 +543,7 @@ void drawModeSwitch(LICE_IBitmap* bmp, int w) {
: hoverState(g_panel.hovered, HoverKind::ModeSegment, i);
fillSurface(bmp, KitBox{s.x, s.y, s.width, s.height}, Role::BgCell, state);
LICE_DrawRect(bmp, s.x, s.y, s.width, s.height,
toLicePixel(roleColor(Role::LineHairline)), 1.0f, 0);
toLice(roleColor(Role::LineHairline)), 1.0f, 0);
const Role tr = active ? Role::BgBase : Role::TextPrimary;
kitText(bmp, KitBox{s.x, s.y, s.width, s.height}, mode.displayName.c_str(),
@@ -585,7 +582,7 @@ void drawTailFooter(LICE_IBitmap* bmp, int w, int h) {
hoverState(g_panel.hovered, HoverKind::Footer, -1);
fillSurface(bmp, KitBox{f.left, f.top, w, kFooterHeight}, Role::BgPanel, footerState);
LICE_Line(bmp, f.left, f.top, f.right, f.top,
toLicePixel(roleColor(Role::LineHairline)), 1.0f, 0, false);
toLice(roleColor(Role::LineHairline)), 1.0f, 0, false);
// Tail-mode toggle, left-aligned (the interactive control — footer clicks cycle it).
const std::string label = tailToggleLabel(currentTail());
@@ -706,6 +703,7 @@ std::vector<ActionBarRow> actionBarRows() {
rows.push_back({def.commandSuffix, label, ActionCluster::Capture});
}
rows.push_back({"CAPTURE_BATCH_ITEMS", "Batch Items", ActionCluster::Capture});
rows.push_back({"CAPTURE_BATCH_RAZOR", "Batch Razor", ActionCluster::Capture});
rows.push_back({"CAPTURE_TRACK_REALTIME", "Capture RT", ActionCluster::Capture});
// Placement cluster.
rows.push_back({"INSERT_SELECTED", "Insert", ActionCluster::Placement});
@@ -783,7 +781,7 @@ void drawActionBar(LICE_IBitmap* bmp, int w, int h) {
const KitBox band{bar.x, bar.y, bar.width, bar.height};
fillSurface(bmp, band, Role::BgPanel, InteractionState::Rest);
LICE_Line(bmp, bar.x, bar.y, bar.x + bar.width, bar.y,
LICE_RGBA(0, 0, 0, 255), 0.5f, 0, false);
toLice(roleColor(Role::LineHairline)), 0.5f, 0, false);
const std::vector<ActionBarRow> rows = actionBarRows();
const std::vector<ClusterSpec> clusters = actionBarClusters(rows);
@@ -1023,7 +1021,7 @@ void drawRegionHeader(LICE_IBitmap* bmp, const RECT& region, const char* title,
fillSurface(bmp, KitBox{hdr.left, hdr.top, hdr.right - hdr.left, hdr.bottom - hdr.top},
Role::BgPanel, InteractionState::Rest);
LICE_Line(bmp, hdr.left, hdr.bottom - 1, hdr.right, hdr.bottom - 1,
toLicePixel(roleColor(Role::LineHairline)), 1.0f, 0, false);
toLice(roleColor(Role::LineHairline)), 1.0f, 0, false);
// Title, left (Font::Title — a region heading).
RECT titleRc = hdr;
@@ -1116,10 +1114,10 @@ void drawTabStrip(LICE_IBitmap* bmp, const RECT& region) {
// The active bank's tab gets a bright accent border (unmistakable), distinct from the
// shown tab's fill — active != shown, made visible (kit accent role).
const KitColor border = active ? roleColor(Role::Accent) : roleColor(Role::LineHairline);
LICE_DrawRect(bmp, tr.x, tr.y, tr.width, tr.height, toLicePixel(border), 1.0f, 0);
LICE_DrawRect(bmp, tr.x, tr.y, tr.width, tr.height, toLice(border), 1.0f, 0);
if (active)
LICE_DrawRect(bmp, tr.x + 1, tr.y + 1, tr.width - 2, tr.height - 2,
toLicePixel(border), 1.0f, 0);
toLice(border), 1.0f, 0);
// Label: bg/base on the accent-active fill for contrast, else text/primary.
const Role trole = active ? Role::BgBase : Role::TextPrimary;
@@ -1146,7 +1144,7 @@ void paintPanel(HWND hwnd, HDC hdc) {
if (w <= 0 || h <= 0) return;
LICE_SysBitmap bmp(w, h);
LICE_Clear(&bmp, toLicePixel(roleColor(Role::BgBase)));
LICE_Clear(&bmp, toLice(roleColor(Role::BgBase)));
const std::string projectDir = currentProjectDir();
const std::string activeName = activeBankName();
@@ -1163,7 +1161,7 @@ void paintPanel(HWND hwnd, HDC hdc) {
const RECT grid = regionGridRect(region, false);
LICE_DrawRect(&bmp, grid.left + 1, grid.top + 1,
grid.right - grid.left - 2, grid.bottom - grid.top - 2,
toLicePixel(roleColor(Role::AccentHot)), 1.0f, 0);
toLice(roleColor(Role::AccentHot)), 1.0f, 0);
}
}
@@ -1172,7 +1170,7 @@ void paintPanel(HWND hwnd, HDC hdc) {
const RECT body = splitBody(w, h);
const int dy = body.top + (body.bottom - body.top - kSplitDividerHeight) / 2;
LICE_FillRect(&bmp, 0, dy, w, kSplitDividerHeight,
toLicePixel(roleColor(Role::BgBase)), 1.0f, 0);
toLice(roleColor(Role::BgBase)), 1.0f, 0);
}
// Named-banks region (bottom).
@@ -1200,7 +1198,7 @@ void paintPanel(HWND hwnd, HDC hdc) {
const RECT grid = regionGridRect(region, true);
LICE_DrawRect(&bmp, grid.left + 1, grid.top + 1,
grid.right - grid.left - 2, grid.bottom - grid.top - 2,
toLicePixel(roleColor(Role::AccentHot)), 1.0f, 0);
toLice(roleColor(Role::AccentHot)), 1.0f, 0);
}
}