Skip to content

Commit

Permalink
Dont show enable switch on modgui
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed May 27, 2024
1 parent 95f13d6 commit 0adc604
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions plugin/MasterMeUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,22 @@ struct TopCenteredGroup : NanoSubWidget
{
const QuantumTheme& theme;

#ifndef __MOD_DEVICES__
QuantumSwitch globalEnableSwitch;
QuantumVerticalSeparatorLine separator;
#endif

explicit TopCenteredGroup(NanoTopLevelWidget* const parent, ButtonEventHandler::Callback* const bcb, const QuantumTheme& t)
: NanoSubWidget(parent),
theme(t),
globalEnableSwitch(this, t),
separator(this, t)
theme(t)
#ifndef __MOD_DEVICES__
, globalEnableSwitch(this, t)
, separator(this, t)
#endif
{
setName("Top Center");

#ifndef __MOD_DEVICES__
globalEnableSwitch.setCallback(bcb);
globalEnableSwitch.setCheckable(true);
globalEnableSwitch.setChecked(kParameterRanges[kParameter_global_bypass].def, false);
Expand All @@ -157,21 +162,26 @@ struct TopCenteredGroup : NanoSubWidget
globalEnableSwitch.setName("Global Enable Button");

separator.setName("+ separator");
#endif
}

void adjustSize(const MasterMeMetrics& metrics, const uint width, const uint height, const uint widgetsHeight)
{
#ifndef __MOD_DEVICES__
globalEnableSwitch.adjustSize();
globalEnableSwitch.setHeight(widgetsHeight);
separator.setSize(metrics.separatorVertical);
separator.setHeight(widgetsHeight);
#endif
setSize(width, height);
}

void setAbsolutePos(int x, const int y)
{
#ifndef __MOD_DEVICES__
globalEnableSwitch.setAbsolutePos(x, y);
separator.setAbsolutePos(globalEnableSwitch.getAbsoluteX() + globalEnableSwitch.getWidth() + theme.padding * 4, y);
#endif
}

void onNanoDisplay() override
Expand Down Expand Up @@ -1246,7 +1256,11 @@ class MasterMeUI : public UI,
name.setAbsolutePos(outputGroup.getAbsoluteX() + outputGroup.getWidth() - name.getWidth(),
(outputGroup.getAbsoluteY() - name.getHeight()) / 2);

topCenteredGroup.setAbsolutePos(name.getAbsoluteX() - topCenteredGroup.globalEnableSwitch.getWidth() - theme.padding * 8 - theme.borderSize,
topCenteredGroup.setAbsolutePos(name.getAbsoluteX()
#ifndef __MOD_DEVICES__
- topCenteredGroup.globalEnableSwitch.getWidth()
#endif
- theme.padding * 8 - theme.borderSize,
theme.windowPadding + theme.borderSize);

easyModeButton.setAbsolutePos(inputGroup.getAbsoluteX(), theme.windowPadding);
Expand Down Expand Up @@ -1340,7 +1354,9 @@ class MasterMeUI : public UI,
{
// inputs
case kParameter_global_bypass:
#ifndef __MOD_DEVICES__
topCenteredGroup.globalEnableSwitch.setChecked(value < 0.5f, false);
#endif
break;
case kParameter_target:
inputGroup.slider.setValue(value, false);
Expand Down

0 comments on commit 0adc604

Please sign in to comment.