From 28780a74bdce278e074e213d7910fb97febe850b Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 2 Sep 2021 13:20:01 -0400 Subject: [PATCH] Remove "Scaled Linear" from Knob Mode menu item. --- src/app/MenuBar.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index 5edba910..3e149abc 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -358,12 +358,8 @@ struct ViewButton : MenuButton { for (int i = 1; i <= 6; i++) { double frameRate = APP->window->getMonitorRefreshRate() / i; menu->addChild(createCheckMenuItem(string::f("%.0f Hz", frameRate), - [=]() { - return settings::frameSwapInterval == i; - }, - [=]() { - settings::frameSwapInterval = i; - } + [=]() {return settings::frameSwapInterval == i;}, + [=]() {settings::frameSwapInterval = i;} )); } })); @@ -380,13 +376,21 @@ struct ViewButton : MenuButton { menu->addChild(createBoolPtrMenuItem("Hide cursor while dragging", &settings::allowCursorLock)); - static const std::vector knobModes = { + static const std::vector knobModeLabels = { "Linear", "Scaled linear", "Absolute rotary", "Relative rotary", }; - menu->addChild(createIndexPtrSubmenuItem("Knob mode", knobModes, &settings::knobMode)); + static const std::vector knobModes = {0, 2, 3}; + menu->addChild(createSubmenuItem("Knob mode", knobModeLabels[settings::knobMode], [=](ui::Menu* menu) { + for (int knobMode : knobModes) { + menu->addChild(createCheckMenuItem(knobModeLabels[knobMode], + [=]() {return settings::knobMode == knobMode;}, + [=]() {settings::knobMode = (settings::KnobMode) knobMode;} + )); + } + })); menu->addChild(createBoolPtrMenuItem("Scroll wheel knob control", &settings::knobScroll));