diff --git a/src/core/Audio.cpp b/src/core/Audio.cpp index adfe1ee6..083226db 100644 --- a/src/core/Audio.cpp +++ b/src/core/Audio.cpp @@ -453,12 +453,12 @@ struct AudioWidget : ModuleWidget { setModule(module); if (NUM_AUDIO_INPUTS == 8 && NUM_AUDIO_OUTPUTS == 8) { - setPanel(Svg::load(asset::system("res/Core/Audio8.svg"))); + setPanel(createPanel(asset::system("res/Core/Audio8.svg"), asset::system("res/Core/Audio8-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addInput(createInputCentered(mm2px(Vec(7.81, 57.929)), module, TAudio::AUDIO_INPUTS + 0)); addInput(createInputCentered(mm2px(Vec(19.359, 57.929)), module, TAudio::AUDIO_INPUTS + 1)); @@ -494,12 +494,12 @@ struct AudioWidget : ModuleWidget { addChild(display); } else if (NUM_AUDIO_INPUTS == 16 && NUM_AUDIO_OUTPUTS == 16) { - setPanel(Svg::load(asset::system("res/Core/Audio16.svg"))); + setPanel(createPanel(asset::system("res/Core/Audio16.svg"), asset::system("res/Core/Audio16-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addInput(createInputCentered(mm2px(Vec(7.815, 57.929)), module, TAudio::AUDIO_INPUTS + 0)); addInput(createInputCentered(mm2px(Vec(19.364, 57.929)), module, TAudio::AUDIO_INPUTS + 1)); @@ -559,12 +559,12 @@ struct AudioWidget : ModuleWidget { addChild(display); } else if (NUM_AUDIO_INPUTS == 2 && NUM_AUDIO_OUTPUTS == 2) { - setPanel(Svg::load(asset::system("res/Core/Audio2.svg"))); + setPanel(createPanel(asset::system("res/Core/Audio2.svg"), asset::system("res/Core/Audio2-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addParam(createParamCentered(mm2px(Vec(12.869, 77.362)), module, TAudio::LEVEL_PARAM)); diff --git a/src/core/Blank.cpp b/src/core/Blank.cpp index 10cd6c64..e251afa6 100644 --- a/src/core/Blank.cpp +++ b/src/core/Blank.cpp @@ -47,7 +47,8 @@ struct BlankPanel : Widget { void draw(const DrawArgs& args) override { nvgBeginPath(args.vg); nvgRect(args.vg, 0.0, 0.0, box.size.x, box.size.y); - nvgFillColor(args.vg, nvgRGB(0xe6, 0xe6, 0xe6)); + NVGcolor bg = settings::preferDarkPanels ? nvgRGB(42, 42, 42) : nvgRGB(235, 235, 235); + nvgFillColor(args.vg, bg); nvgFill(args.vg); Widget::draw(args); } @@ -141,10 +142,10 @@ struct BlankWidget : ModuleWidget { rightHandle->module = module; addChild(rightHandle); - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(15, 365))); - topRightScrew = createWidget(Vec(box.size.x - 30, 0)); - bottomRightScrew = createWidget(Vec(box.size.x - 30, 365)); + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(15, 365))); + topRightScrew = createWidget(Vec(box.size.x - 30, 0)); + bottomRightScrew = createWidget(Vec(box.size.x - 30, 365)); addChild(topRightScrew); addChild(bottomRightScrew); diff --git a/src/core/CV_MIDI.cpp b/src/core/CV_MIDI.cpp index 3716d81e..8c67dbf2 100644 --- a/src/core/CV_MIDI.cpp +++ b/src/core/CV_MIDI.cpp @@ -149,12 +149,12 @@ struct CV_MIDIPanicItem : MenuItem { struct CV_MIDIWidget : ModuleWidget { CV_MIDIWidget(CV_MIDI* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/CV_MIDI.svg"))); + setPanel(createPanel(asset::system("res/Core/CV_MIDI.svg"), asset::system("res/Core/CV_MIDI-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addInput(createInputCentered(mm2px(Vec(7.906, 64.347)), module, CV_MIDI::PITCH_INPUT)); addInput(createInputCentered(mm2px(Vec(20.249, 64.347)), module, CV_MIDI::GATE_INPUT)); diff --git a/src/core/CV_MIDICC.cpp b/src/core/CV_MIDICC.cpp index 85359dd3..c96ad7ce 100644 --- a/src/core/CV_MIDICC.cpp +++ b/src/core/CV_MIDICC.cpp @@ -138,12 +138,12 @@ struct CV_MIDICC : Module { struct CV_MIDICCWidget : ModuleWidget { CV_MIDICCWidget(CV_MIDICC* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/CV_MIDICC.svg"))); + setPanel(createPanel(asset::system("res/Core/CV_MIDICC.svg"), asset::system("res/Core/CV_MIDICC-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addInput(createInputCentered(mm2px(Vec(8.189, 78.431)), module, CV_MIDICC::CC_INPUTS + 0)); addInput(createInputCentered(mm2px(Vec(19.739, 78.431)), module, CV_MIDICC::CC_INPUTS + 1)); diff --git a/src/core/Gate_MIDI.cpp b/src/core/Gate_MIDI.cpp index e940cbfd..4f8a881b 100644 --- a/src/core/Gate_MIDI.cpp +++ b/src/core/Gate_MIDI.cpp @@ -179,12 +179,12 @@ struct Gate_MIDI : Module { struct Gate_MIDIWidget : ModuleWidget { Gate_MIDIWidget(Gate_MIDI* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/Gate_MIDI.svg"))); + setPanel(createPanel(asset::system("res/Core/Gate_MIDI.svg"), asset::system("res/Core/Gate_MIDI-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addInput(createInputCentered(mm2px(Vec(8.189, 78.431)), module, Gate_MIDI::GATE_INPUTS + 0)); addInput(createInputCentered(mm2px(Vec(19.739, 78.431)), module, Gate_MIDI::GATE_INPUTS + 1)); diff --git a/src/core/MIDICC_CV.cpp b/src/core/MIDICC_CV.cpp index f7d126dc..97d1db32 100644 --- a/src/core/MIDICC_CV.cpp +++ b/src/core/MIDICC_CV.cpp @@ -229,12 +229,12 @@ struct MIDICC_CV : Module { struct MIDICC_CVWidget : ModuleWidget { MIDICC_CVWidget(MIDICC_CV* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDICC_CV.svg"))); + setPanel(createPanel(asset::system("res/Core/MIDICC_CV.svg"), asset::system("res/Core/MIDICC_CV-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDICC_CV::CC_OUTPUT + 0)); addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDICC_CV::CC_OUTPUT + 1)); diff --git a/src/core/MIDIMap.cpp b/src/core/MIDIMap.cpp index 5fb4dd0f..70f7431a 100644 --- a/src/core/MIDIMap.cpp +++ b/src/core/MIDIMap.cpp @@ -478,12 +478,12 @@ struct MIDIMapDisplay : MidiDisplay { struct MIDIMapWidget : ModuleWidget { MIDIMapWidget(MIDIMap* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDIMap.svg"))); + setPanel(createPanel(asset::system("res/Core/MIDIMap.svg"), asset::system("res/Core/MIDIMap-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); MIDIMapDisplay* display = createWidget(mm2px(Vec(0.0, 12.869))); display->box.size = mm2px(Vec(50.8, 105.059)); diff --git a/src/core/MIDI_CV.cpp b/src/core/MIDI_CV.cpp index 8d0af276..d716b567 100644 --- a/src/core/MIDI_CV.cpp +++ b/src/core/MIDI_CV.cpp @@ -491,12 +491,12 @@ struct MIDI_CV : Module { struct MIDI_CVWidget : ModuleWidget { MIDI_CVWidget(MIDI_CV* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI_CV.svg"))); + setPanel(createPanel(asset::system("res/Core/MIDI_CV.svg"), asset::system("res/Core/MIDI_CV-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addOutput(createOutputCentered(mm2px(Vec(7.905, 64.347)), module, MIDI_CV::PITCH_OUTPUT)); addOutput(createOutputCentered(mm2px(Vec(20.248, 64.347)), module, MIDI_CV::GATE_OUTPUT)); diff --git a/src/core/MIDI_Gate.cpp b/src/core/MIDI_Gate.cpp index 96eb8cb3..cbcd0fd6 100644 --- a/src/core/MIDI_Gate.cpp +++ b/src/core/MIDI_Gate.cpp @@ -193,12 +193,12 @@ struct MIDI_Gate : Module { struct MIDI_GateWidget : ModuleWidget { MIDI_GateWidget(MIDI_Gate* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI_Gate.svg"))); + setPanel(createPanel(asset::system("res/Core/MIDI_Gate.svg"), asset::system("res/Core/MIDI_Gate-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 0)); addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 1)); diff --git a/src/core/Notes.cpp b/src/core/Notes.cpp index 81ef30a4..3085cf0d 100644 --- a/src/core/Notes.cpp +++ b/src/core/Notes.cpp @@ -70,12 +70,12 @@ struct NotesDisplay : LedDisplay { struct NotesWidget : ModuleWidget { NotesWidget(NotesModule* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/Notes.svg"))); + setPanel(createPanel(asset::system("res/Core/Notes.svg"), asset::system("res/Core/Notes-dark.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); NotesDisplay* notesDisplay = createWidget(mm2px(Vec(0.0, 12.869))); notesDisplay->box.size = mm2px(Vec(81.28, 105.059));