Use ThemedScrew class for Core internal plugins
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
d747d918bb
commit
44029a3c1e
5 changed files with 16 additions and 35 deletions
|
@ -541,10 +541,10 @@ struct AudioFileWidget : ModuleWidgetWithSideScrews<23> {
|
||||||
setModule(module);
|
setModule(module);
|
||||||
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/AudioFile.svg")));
|
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/AudioFile.svg")));
|
||||||
|
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 4 * RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - 4 * RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
|
|
||||||
addOutput(createOutput<PJ301MPort>(Vec(startX_Out, startY_list * 0.5f - padding + 2.0f), module, 0));
|
addOutput(createOutput<PJ301MPort>(Vec(startX_Out, startY_list * 0.5f - padding + 2.0f), module, 0));
|
||||||
addOutput(createOutput<PJ301MPort>(Vec(startX_Out, startY_list * 0.5f + 2.0f), module, 1));
|
addOutput(createOutput<PJ301MPort>(Vec(startX_Out, startY_list * 0.5f + 2.0f), module, 1));
|
||||||
|
|
|
@ -303,8 +303,8 @@ struct CardinalExpanderForInputMIDIWidget : ModuleWidgetWith3HP {
|
||||||
setModule(m);
|
setModule(m);
|
||||||
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ExpanderMIDI.svg")));
|
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ExpanderMIDI.svg")));
|
||||||
|
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
|
|
||||||
for (int i=0; i<CardinalExpanderForInputMIDI::NUM_INPUTS; ++i)
|
for (int i=0; i<CardinalExpanderForInputMIDI::NUM_INPUTS; ++i)
|
||||||
addInput(createInput<PJ301MPort>(Vec(startX + 4.0f, startY + padding * i), m, i));
|
addInput(createInput<PJ301MPort>(Vec(startX + 4.0f, startY + padding * i), m, i));
|
||||||
|
|
|
@ -507,8 +507,8 @@ struct CardinalExpanderForOutputMIDIWidget : ModuleWidgetWith3HP {
|
||||||
setModule(m);
|
setModule(m);
|
||||||
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ExpanderMIDI.svg")));
|
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ExpanderMIDI.svg")));
|
||||||
|
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
|
|
||||||
for (int i=0; i<CardinalExpanderForOutputMIDI::NUM_OUTPUTS; ++i)
|
for (int i=0; i<CardinalExpanderForOutputMIDI::NUM_OUTPUTS; ++i)
|
||||||
addOutput(createOutput<PJ301MPort>(Vec(startX + 4.0f, startY + padding * i), m, i));
|
addOutput(createOutput<PJ301MPort>(Vec(startX + 4.0f, startY + padding * i), m, i));
|
||||||
|
|
|
@ -55,15 +55,15 @@ struct ModuleWidgetWithSideScrews : ModuleWidget {
|
||||||
|
|
||||||
void createAndAddScrews() {
|
void createAndAddScrews() {
|
||||||
if (hp > 3) {
|
if (hp > 3) {
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
} else {
|
} else {
|
||||||
addChild(createWidget<ScrewBlack>(Vec(0, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(0, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(0, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(0, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ThemedScrew>(Vec(box.size.x - RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1310,25 +1310,6 @@ NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* con
|
||||||
goto postparse;
|
goto postparse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special case for light/dark screws
|
|
||||||
if (std::strncmp(filename + (filenamelen-15), "/ScrewBlack.svg", 15) == 0 && filename[filenamelen-16] != '.')
|
|
||||||
{
|
|
||||||
const std::string silverfilename = std::string(filename).substr(0, filenamelen-9) + "Silver.svg";
|
|
||||||
hasLightMode = true;
|
|
||||||
shapesOrig = shapesMOD = nullptr;
|
|
||||||
handleMOD = nsvgParseFromFile(silverfilename.c_str(), units, dpi);
|
|
||||||
goto postparse;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std::strncmp(filename + (filenamelen-16), "/ScrewSilver.svg", 16) == 0 && filename[filenamelen-17] != '.')
|
|
||||||
{
|
|
||||||
const std::string blackfilename = std::string(filename).substr(0, filenamelen-10) + "Black.svg";
|
|
||||||
hasDarkMode = true;
|
|
||||||
shapesOrig = shapesMOD = nullptr;
|
|
||||||
handleMOD = nsvgParseFromFile(blackfilename.c_str(), units, dpi);
|
|
||||||
goto postparse;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Special case for GlueTheGiant
|
// Special case for GlueTheGiant
|
||||||
if (std::strstr(filename, "/GlueTheGiant/res/") != nullptr)
|
if (std::strstr(filename, "/GlueTheGiant/res/") != nullptr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue