Files
reasampler/src/mode_enable.cpp
T
daniel 7cd0771e45 L5: dock-panel button refinements — overflow menu, tooltips, opposite-mode tag buttons
Top-bar rare-capture variants move to a right-anchored More popup; short faces gain
hover-delay full-name tooltips (prefix stripped); bottom bar becomes four opposite-mode
Item/Track tag buttons + Show Both (Toggle/Activates dropped); wider cluster gaps. New
pure overflow_menu/mode_enable/tooltip modules, CTest-covered. Same actions, same contract.
2026-07-26 23:56:49 -04:00

22 lines
841 B
C++

// mode_enable — pure implementation. See mode_enable.h. NO REAPER / SWELL / LICE / vendor.
#include "mode_enable.h"
#include "view_mode_model.h" // kArrangeModeId / kDesignModeId — the ONE home for the mode ids
namespace reasampler {
bool tagButtonEnabled(const std::string& activeModeId, TagTarget target) {
// The target's own mode id, so the rule is a single "target != active" compare.
const char* targetId =
(target == TagTarget::Arrange) ? kArrangeModeId : kDesignModeId;
// Fail-open on an unrecognized active id (neither seed mode): every button live, so a
// future added mode never dead-locks the bar and the user can always reach the action.
if (activeModeId != kArrangeModeId && activeModeId != kDesignModeId) return true;
return activeModeId != targetId;
}
} // namespace reasampler