commit a5522eddad5140cfc01853f3c7fb9fe4f8047f26
parent a534a875929c09c5cf9b32c9b9bcb0703f9a0bce
Author: Adam M <[email protected]>
Date: Tue, 25 Dec 2018 21:33:38 -0600
align inputs with knobs, put background for the step and active display
Diffstat:
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp
@@ -151,6 +151,7 @@ struct SmallLetterDisplay : TransparentWidget {
std::shared_ptr<Font> font;
int fontSize = 19;
std::string defaultFontPath = "res/Oswald-Regular.ttf";
+ NVGcolor baseColor = COLOR_COMPUTERSCARE_TRANSPARENT;
float letterSpacing = 2.5;
int textAlign = 1;
@@ -171,21 +172,22 @@ struct SmallLetterDisplay : TransparentWidget {
NVGcolor backgroundColor = COLOR_COMPUTERSCARE_RED;
NVGcolor doubleblinkColor = COLOR_COMPUTERSCARE_YELLOW;
-
- if(doubleblink) {
- nvgBeginPath(vg);
+ nvgBeginPath(vg);
nvgRoundedRect(vg, 1.0, -1.0, box.size.x-3, box.size.y-3, 8.0);
+ if(doubleblink) {
+
nvgFillColor(vg, doubleblinkColor);
- nvgFill(vg);
}
else {
if(blink) {
- nvgBeginPath(vg);
- nvgRoundedRect(vg, 1.0, -1.0, box.size.x-3, box.size.y-3, 8.0);
nvgFillColor(vg, backgroundColor);
- nvgFill(vg);
+
+ }
+ else {
+ nvgFillColor(vg, baseColor);
}
}
+ nvgFill(vg);
// text
nvgFontSize(vg, fontSize);
diff --git a/src/ComputerscareILoveCookies.cpp b/src/ComputerscareILoveCookies.cpp
@@ -389,13 +389,13 @@ struct ComputerscareILoveCookiesWidget : ModuleWidget {
double knobXStart = 20;
double knobYStart = 2;
double knobRowWidth = 11;
- double knobColumnHeight = 9.2;
+ double knobColumnHeight = 9.58;
double inputPosX = 0.0;
double inputPosY = 0.0;
double inputXStart = 0;
double inputYStart = 0;
- double inputRowWidth = 8;
+ double inputRowWidth = 9.4;
double inputColumnHeight = 9.7;
ComputerscareILoveCookiesWidget(ComputerscareILoveCookies *module) : ModuleWidget(module) {
@@ -479,6 +479,7 @@ struct ComputerscareILoveCookiesWidget : ModuleWidget {
smallLetterDisplay = new SmallLetterDisplay();
smallLetterDisplay->box.pos = mm2px(Vec(21+xStart,verticalStart - 9.2 +verticalSpacing*i));
smallLetterDisplay->box.size = Vec(60, 30);
+ smallLetterDisplay->baseColor = COLOR_COMPUTERSCARE_LIGHT_GREEN;
smallLetterDisplay->value = "?\n?";
addChild(smallLetterDisplay);
module->smallLetterDisplays[i] = smallLetterDisplay;