Q-W2 review follow-ups: anon-namespace TU-private panel helpers, fix stale bank_panel.cpp comments, correct shim-transitivity claim

Wraps ~50 file-local helpers across all eight panel TUs in namespace{} (dissolves the menuAppend default-arg ODR trap); zero behavior change, 60/60 green.
This commit is contained in:
2026-07-29 11:28:48 -04:00
parent 30a4ffd01b
commit 19b12186ac
8 changed files with 64 additions and 6 deletions
+8
View File
@@ -30,6 +30,8 @@ namespace reasampler::panel {
constexpr int kDragThreshold = 5; // px the pointer must move to begin a drag
namespace {
// Resolves the drop target under client (x, y) during a drag, updating dropKind /
// dropBankId. A drop onto the pool region -> the pool; onto a named tab -> that bank;
// anywhere else -> none.
@@ -234,6 +236,8 @@ void updateHover(int x, int y) {
}
}
} // namespace
// Applies the tooltip hover-delay: if a tooltip-bearing element has been hovered past
// kTooltipDelayMs and the tooltip is not yet shown, latch it and repaint once. Driven from the
// OnTimer poll (bankPanelRefresh) so the tooltip appears after a rest with no dedicated timer;
@@ -365,6 +369,8 @@ void onMouseMove(int x, int y) {
// batched undo point + saves). A no-op reorder (already at the target, model returns false)
// opens no undo point. Selection reasons over slot order, so it is cleared after — the
// fingerprint pass rebuilds it against the new order.
namespace {
void doReorderDrop(const std::string& id, const std::string& bankId, int targetSlot) {
if (!book() || id.empty() || bankId.empty() || targetSlot < 0) return;
if (!book()->reorderSample(id, bankId, targetSlot)) return; // rejected/no-op: no undo point
@@ -386,6 +392,8 @@ void doReplaceDrop(const std::string& newId, const std::string& oldId,
invalidatePanel();
}
} // namespace
// Clears all drag-state fields to their resting values. Called from every exit path
// (button-up, WM_CAPTURECHANGED, WM_DESTROY, closePanel) so the set of cleared fields
// stays consistent across all four sites.