| @@ -51,7 +51,7 @@ struct ModuleWidget : widget::OpaqueWidget { | |||||
| */ | */ | ||||
| void setPanel(widget::Widget* panel); | void setPanel(widget::Widget* panel); | ||||
| /** Use `setPanel(createPanel(svg))` instead. */ | /** Use `setPanel(createPanel(svg))` instead. */ | ||||
| DEPRECATED void setPanel(std::shared_ptr<Svg> svg); | |||||
| void setPanel(std::shared_ptr<Svg> svg); | |||||
| /** Convenience functions for adding special widgets (calls addChild()) */ | /** Convenience functions for adding special widgets (calls addChild()) */ | ||||
| void addParam(ParamWidget* param); | void addParam(ParamWidget* param); | ||||
| @@ -20,11 +20,10 @@ struct SvgPanel : widget::Widget { | |||||
| widget::SvgWidget* sw; | widget::SvgWidget* sw; | ||||
| PanelBorder* panelBorder; | PanelBorder* panelBorder; | ||||
| std::shared_ptr<Svg> svg; | std::shared_ptr<Svg> svg; | ||||
| std::shared_ptr<Svg> darkSvg; | |||||
| SvgPanel(); | SvgPanel(); | ||||
| void step() override; | void step() override; | ||||
| void setBackground(std::shared_ptr<Svg> svg, std::shared_ptr<Svg> darkSvg = NULL); | |||||
| void setBackground(std::shared_ptr<Svg> svg); | |||||
| }; | }; | ||||
| @@ -56,13 +56,10 @@ TWidget* createWidgetCentered(math::Vec pos) { | |||||
| return o; | return o; | ||||
| } | } | ||||
| inline app::SvgPanel* createPanel(std::string svgPath, std::string darkSvgPath = "") { | |||||
| inline app::SvgPanel* createPanel(std::string svgPath) { | |||||
| app::SvgPanel* panel = new app::SvgPanel; | app::SvgPanel* panel = new app::SvgPanel; | ||||
| std::shared_ptr<Svg> svg = APP->window->loadSvg(svgPath); | std::shared_ptr<Svg> svg = APP->window->loadSvg(svgPath); | ||||
| std::shared_ptr<Svg> darkSvg; | |||||
| if (darkSvgPath != "") | |||||
| darkSvg = APP->window->loadSvg(darkSvgPath); | |||||
| panel->setBackground(svg, darkSvg); | |||||
| panel->setBackground(svg); | |||||
| return panel; | return panel; | ||||
| } | } | ||||
| @@ -42,7 +42,6 @@ extern int threadCount; | |||||
| extern bool paramTooltip; | extern bool paramTooltip; | ||||
| extern bool cpuMeter; | extern bool cpuMeter; | ||||
| extern bool lockModules; | extern bool lockModules; | ||||
| extern bool darkMode; | |||||
| extern int frameSwapInterval; | extern int frameSwapInterval; | ||||
| extern float autosavePeriod; | extern float autosavePeriod; | ||||
| extern bool skipLoadOnLaunch; | extern bool skipLoadOnLaunch; | ||||
| @@ -57,9 +56,6 @@ void fromJson(json_t* rootJ); | |||||
| void save(const std::string& path); | void save(const std::string& path); | ||||
| void load(const std::string& path); | void load(const std::string& path); | ||||
| // Getters, for ensuring API/ABI compatibility for plugins | |||||
| bool isDarkMode(); | |||||
| } // namespace settings | } // namespace settings | ||||
| } // namespace rack | } // namespace rack | ||||
| @@ -384,12 +384,6 @@ struct LockModulesItem : ui::MenuItem { | |||||
| } | } | ||||
| }; | }; | ||||
| struct DarkModeItem : ui::MenuItem { | |||||
| void onAction(const event::Action& e) override { | |||||
| settings::darkMode ^= true; | |||||
| } | |||||
| }; | |||||
| struct FrameRateValueItem : ui::MenuItem { | struct FrameRateValueItem : ui::MenuItem { | ||||
| int frameSwapInterval; | int frameSwapInterval; | ||||
| void onAction(const event::Action& e) override { | void onAction(const event::Action& e) override { | ||||
| @@ -458,11 +452,6 @@ struct ViewButton : MenuButton { | |||||
| cableTensionSlider->box.size.x = 200.0; | cableTensionSlider->box.size.x = 200.0; | ||||
| menu->addChild(cableTensionSlider); | menu->addChild(cableTensionSlider); | ||||
| DarkModeItem* darkModeItem = new DarkModeItem; | |||||
| darkModeItem->text = "Dark mode"; | |||||
| darkModeItem->rightText = CHECKMARK(settings::darkMode); | |||||
| menu->addChild(darkModeItem); | |||||
| FrameRateItem* frameRateItem = new FrameRateItem; | FrameRateItem* frameRateItem = new FrameRateItem; | ||||
| frameRateItem->text = "Frame rate"; | frameRateItem->text = "Frame rate"; | ||||
| frameRateItem->rightText = RIGHT_ARROW; | frameRateItem->rightText = RIGHT_ARROW; | ||||
| @@ -34,20 +34,11 @@ void SvgPanel::step() { | |||||
| fb->oversample = 2.0; | fb->oversample = 2.0; | ||||
| } | } | ||||
| std::shared_ptr<Svg> svg = this->svg; | |||||
| if (settings::isDarkMode() && this->darkSvg) | |||||
| svg = this->darkSvg; | |||||
| if (sw->svg != svg) { | |||||
| sw->setSvg(svg); | |||||
| fb->dirty = true; | |||||
| } | |||||
| Widget::step(); | Widget::step(); | ||||
| } | } | ||||
| void SvgPanel::setBackground(std::shared_ptr<Svg> svg, std::shared_ptr<Svg> darkSvg) { | |||||
| void SvgPanel::setBackground(std::shared_ptr<Svg> svg) { | |||||
| this->svg = svg; | this->svg = svg; | ||||
| this->darkSvg = darkSvg; | |||||
| sw->setSvg(svg); | sw->setSvg(svg); | ||||
| fb->box.size = sw->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE); | fb->box.size = sw->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE); | ||||
| @@ -30,7 +30,6 @@ int threadCount = 1; | |||||
| bool paramTooltip = true; | bool paramTooltip = true; | ||||
| bool cpuMeter = false; | bool cpuMeter = false; | ||||
| bool lockModules = false; | bool lockModules = false; | ||||
| bool darkMode = false; | |||||
| #if defined ARCH_MAC | #if defined ARCH_MAC | ||||
| // Most Mac GPUs can't handle rendering the screen every frame, so use ~30 Hz by default. | // Most Mac GPUs can't handle rendering the screen every frame, so use ~30 Hz by default. | ||||
| int frameSwapInterval = 2; | int frameSwapInterval = 2; | ||||
| @@ -87,8 +86,6 @@ json_t* toJson() { | |||||
| json_object_set_new(rootJ, "lockModules", json_boolean(lockModules)); | json_object_set_new(rootJ, "lockModules", json_boolean(lockModules)); | ||||
| json_object_set_new(rootJ, "darkMode", json_boolean(darkMode)); | |||||
| json_object_set_new(rootJ, "frameSwapInterval", json_integer(frameSwapInterval)); | json_object_set_new(rootJ, "frameSwapInterval", json_integer(frameSwapInterval)); | ||||
| json_object_set_new(rootJ, "autosavePeriod", json_real(autosavePeriod)); | json_object_set_new(rootJ, "autosavePeriod", json_real(autosavePeriod)); | ||||
| @@ -191,10 +188,6 @@ void fromJson(json_t* rootJ) { | |||||
| if (lockModulesJ) | if (lockModulesJ) | ||||
| lockModules = json_boolean_value(lockModulesJ); | lockModules = json_boolean_value(lockModulesJ); | ||||
| json_t* darkModeJ = json_object_get(rootJ, "darkMode"); | |||||
| if (darkModeJ) | |||||
| darkMode = json_boolean_value(darkModeJ); | |||||
| json_t* frameSwapIntervalJ = json_object_get(rootJ, "frameSwapInterval"); | json_t* frameSwapIntervalJ = json_object_get(rootJ, "frameSwapInterval"); | ||||
| if (frameSwapIntervalJ) | if (frameSwapIntervalJ) | ||||
| frameSwapInterval = json_integer_value(frameSwapIntervalJ); | frameSwapInterval = json_integer_value(frameSwapIntervalJ); | ||||
| @@ -286,10 +279,5 @@ void load(const std::string& path) { | |||||
| } | } | ||||
| bool isDarkMode() { | |||||
| return darkMode; | |||||
| } | |||||
| } // namespace settings | } // namespace settings | ||||
| } // namespace rack | } // namespace rack | ||||