@@ -11,10 +11,9 @@ void MultiLightWidget::addBaseColor(NVGcolor baseColor) { | |||||
void MultiLightWidget::setValues(const std::vector<float> &values) { | void MultiLightWidget::setValues(const std::vector<float> &values) { | ||||
assert(values.size() == baseColors.size()); | assert(values.size() == baseColors.size()); | ||||
color = bgColor; | |||||
color = nvgRGBf(0, 0, 0); | |||||
for (size_t i = 0; i < baseColors.size(); i++) { | for (size_t i = 0; i < baseColors.size(); i++) { | ||||
NVGcolor c = baseColors[i]; | NVGcolor c = baseColors[i]; | ||||
c = colorMinus(c, bgColor); | |||||
c = colorMult(c, values[i]); | c = colorMult(c, values[i]); | ||||
color = colorPlus(color, c); | color = colorPlus(color, c); | ||||
} | } | ||||
@@ -55,7 +55,6 @@ void RackWidget::clear() { | |||||
wireContainer->activeWire = NULL; | wireContainer->activeWire = NULL; | ||||
wireContainer->clearChildren(); | wireContainer->clearChildren(); | ||||
moduleContainer->clearChildren(); | moduleContainer->clearChildren(); | ||||
lastPath = ""; | |||||
gRackScene->scrollWidget->offset = Vec(0, 0); | gRackScene->scrollWidget->offset = Vec(0, 0); | ||||
} | } | ||||
@@ -63,7 +62,9 @@ void RackWidget::clear() { | |||||
void RackWidget::reset() { | void RackWidget::reset() { | ||||
if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, "Clear your patch and start over?")) { | if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, "Clear your patch and start over?")) { | ||||
clear(); | clear(); | ||||
// Fails silently if file does not exist | |||||
loadPatch(assetLocal("template.vcv")); | loadPatch(assetLocal("template.vcv")); | ||||
lastPath = ""; | |||||
} | } | ||||
} | } | ||||
@@ -392,7 +392,7 @@ static void serverRun() { | |||||
int client = accept(server, NULL, NULL); | int client = accept(server, NULL, NULL); | ||||
if (client < 0) { | if (client < 0) { | ||||
// Wait a bit before attempting to accept another client | // Wait a bit before attempting to accept another client | ||||
std::this_thread::sleep_for(std::chrono::duration<float>(0.1)); | |||||
std::this_thread::sleep_for(std::chrono::duration<double>(0.1)); | |||||
continue; | continue; | ||||
} | } | ||||
@@ -547,9 +547,9 @@ void windowSetTheme(NVGcolor bg, NVGcolor fg) { | |||||
// Assume dark background and light foreground | // Assume dark background and light foreground | ||||
BNDwidgetTheme w; | BNDwidgetTheme w; | ||||
w.outlineColor = colorMinus(bg, nvgRGB(0x10, 0x10, 0x10)); | |||||
w.outlineColor = bg; | |||||
w.itemColor = fg; | w.itemColor = fg; | ||||
w.innerColor = colorMinus(bg, nvgRGB(0x10, 0x10, 0x10)); | |||||
w.innerColor = bg; | |||||
w.innerSelectedColor = colorPlus(bg, nvgRGB(0x30, 0x30, 0x30)); | w.innerSelectedColor = colorPlus(bg, nvgRGB(0x30, 0x30, 0x30)); | ||||
w.textColor = fg; | w.textColor = fg; | ||||
w.textSelectedColor = fg; | w.textSelectedColor = fg; | ||||
@@ -571,7 +571,7 @@ void windowSetTheme(NVGcolor bg, NVGcolor fg) { | |||||
t.menuTheme = w; | t.menuTheme = w; | ||||
t.menuItemTheme = w; | t.menuItemTheme = w; | ||||
t.sliderTheme.itemColor = colorMinus(bg, nvgRGB(0x10, 0x10, 0x10)); | |||||
t.sliderTheme.itemColor = bg; | |||||
t.sliderTheme.innerColor = colorPlus(bg, nvgRGB(0x50, 0x50, 0x50)); | t.sliderTheme.innerColor = colorPlus(bg, nvgRGB(0x50, 0x50, 0x50)); | ||||
t.sliderTheme.innerSelectedColor = colorPlus(bg, nvgRGB(0x60, 0x60, 0x60)); | t.sliderTheme.innerSelectedColor = colorPlus(bg, nvgRGB(0x60, 0x60, 0x60)); | ||||
@@ -581,6 +581,7 @@ void windowSetTheme(NVGcolor bg, NVGcolor fg) { | |||||
t.scrollBarTheme.itemColor = colorPlus(bg, nvgRGB(0x50, 0x50, 0x50)); | t.scrollBarTheme.itemColor = colorPlus(bg, nvgRGB(0x50, 0x50, 0x50)); | ||||
t.scrollBarTheme.innerColor = bg; | t.scrollBarTheme.innerColor = bg; | ||||
t.menuTheme.innerColor = colorMinus(bg, nvgRGB(0x10, 0x10, 0x10)); | |||||
t.menuTheme.textColor = colorMinus(fg, nvgRGB(0x50, 0x50, 0x50)); | t.menuTheme.textColor = colorMinus(fg, nvgRGB(0x50, 0x50, 0x50)); | ||||
t.menuTheme.textSelectedColor = t.menuTheme.textColor; | t.menuTheme.textSelectedColor = t.menuTheme.textColor; | ||||