Merge: drop membership count from mode switch labels
This commit is contained in:
+4
-14
@@ -383,8 +383,7 @@ int modeCount() {
|
||||
|
||||
// Draws the segmented mode switch into the header strip of width `w`: one segment
|
||||
// per registered mode (ordinal order), the active mode lit, each labeled with its
|
||||
// display name and a cheap membership indicator (count of tracks tagged into that
|
||||
// mode). READ-ONLY: reads g_session->view() live; never mutates the model here
|
||||
// display name. READ-ONLY: reads g_session->view() live; never mutates the model here
|
||||
// (activation happens on click, in handleClick).
|
||||
void drawModeSwitch(LICE_IBitmap* bmp, int w) {
|
||||
if (!g_panel.session) return;
|
||||
@@ -400,11 +399,6 @@ void drawModeSwitch(LICE_IBitmap* bmp, int w) {
|
||||
const std::vector<SegmentRect> segs = computeSegmentRects(header, n);
|
||||
if (segs.empty()) return;
|
||||
|
||||
// Cheap per-mode membership count: how many tagged leaves opted into this mode.
|
||||
// Iterate the membership index once per mode (tiny N of modes; the index is the
|
||||
// set of TAGGED tracks, not all tracks — bounded and cheap). Untagged tracks are
|
||||
// Arrange members by default but are NOT in the index, so this is a "tagged into"
|
||||
// count, which is the sensible, cheap indicator (not a full tree walk).
|
||||
const std::string& activeId = view.activeModeId();
|
||||
HDC dc = bmp->getDC();
|
||||
|
||||
@@ -419,13 +413,9 @@ void drawModeSwitch(LICE_IBitmap* bmp, int w) {
|
||||
|
||||
if (!dc) continue;
|
||||
|
||||
int members = 0;
|
||||
for (const auto& entry : view.membership().all())
|
||||
if (entry.second.modeIds.count(mode.id) != 0) ++members;
|
||||
|
||||
// "DisplayName (count)" centered in the segment. A single-line centered
|
||||
// label; the segment is wide enough for the seed modes' short names.
|
||||
std::string label = mode.displayName + " (" + std::to_string(members) + ")";
|
||||
// Display name centered in the segment. A single-line centered label;
|
||||
// the segment is wide enough for the seed modes' short names.
|
||||
const std::string& label = mode.displayName;
|
||||
RECT rc{s.x, s.y, s.x + s.width, s.y + s.height};
|
||||
SetTextColor(dc, active ? kRgbSegActiveText : kRgbSegText);
|
||||
SetBkMode(dc, TRANSPARENT);
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ struct HeaderRect {
|
||||
};
|
||||
|
||||
// One segment's pixel rectangle within the header, top-left origin. These are the
|
||||
// draw bounds for one mode's button; the panel draws the mode's label + membership
|
||||
// indicator inside it and lights it when it is the active mode.
|
||||
// draw bounds for one mode's button; the panel draws the mode's display name inside
|
||||
// it and lights it when it is the active mode.
|
||||
struct SegmentRect {
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
Reference in New Issue
Block a user