BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit 704460b60a62443e9121cd5c4f9284d3c35ce19f
parent 23052bd87510cbf2627f2eaedf33a80874c97fa5
Author: Matt Demanett <matt@demanett.net>
Date:   Thu, 30 May 2019 19:54:20 -0400

v1: supress right click on MIX1 mute MIX4/8 master mute, for consistency with channel mute buttons, where right click solos the channel.

Diffstat:
Msrc/mixer.cpp | 14++++++++++++++
Msrc/mixer.hpp | 2++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/mixer.cpp b/src/mixer.cpp @@ -49,6 +49,20 @@ void MixerChannel::next(bool stereo, bool solo) { } +void MuteButton::onButton(const event::Button& e) { + if (!(e.action == GLFW_PRESS && (e.mods & RACK_MOD_MASK) == 0)) { + return; + } + + if (e.button == GLFW_MOUSE_BUTTON_RIGHT) { + e.consume(this); + } + else { + ToggleButton::onButton(e); + } +} + + SoloMuteButton::SoloMuteButton() { shadow = new CircularShadow(); addChild(shadow); diff --git a/src/mixer.hpp b/src/mixer.hpp @@ -63,6 +63,8 @@ struct MuteButton : ToggleButton { addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/button_18px_0.svg"))); addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/button_18px_1_orange.svg"))); } + + void onButton(const event::Button& e) override; }; struct SoloMuteButton : ParamWidget {