diff --git a/resources/data/skins/tests/test-minimal-position.surge-skin/skin.xml b/resources/data/skins/tests/test-minimal-position.surge-skin/skin.xml index 6175c653d66..a7ceeecf24c 100644 --- a/resources/data/skins/tests/test-minimal-position.surge-skin/skin.xml +++ b/resources/data/skins/tests/test-minimal-position.surge-skin/skin.xml @@ -7,6 +7,14 @@ + + + + + + + + diff --git a/src/common/gui/CLFOGui.cpp b/src/common/gui/CLFOGui.cpp index 35143e39fb5..4c1e7f4bc05 100644 --- a/src/common/gui/CLFOGui.cpp +++ b/src/common/gui/CLFOGui.cpp @@ -933,8 +933,8 @@ void CLFOGui::drawStepSeq(VSTGUI::CDrawContext *dc, VSTGUI::CRect &maindisp, VST } } - int dragX, dragY; - int dragW = (prec > 4 ? 60 : 40), dragH = (keyModMult ? 22 : 12); + float dragX, dragY; + float dragW = (prec > 4 ? 60 : 40), dragH = (keyModMult ? 22 : 12); auto sr = steprect[draggedStep]; @@ -952,12 +952,12 @@ void CLFOGui::drawStepSeq(VSTGUI::CDrawContext *dc, VSTGUI::CRect &maindisp, VST if (lfodata->unipolar.val.b) { auto sv = std::max(ss->steps[draggedStep], 0.f); - yTop = sr.bottom - (int)(sr.getHeight() * sv); + yTop = sr.bottom - (sr.getHeight() * sv); } else { yTop = sr.bottom - - (int)((float)0.5f + sr.getHeight() * (0.5f + 0.5f * ss->steps[draggedStep])); + ((float)0.5f + sr.getHeight() * (0.5f + 0.5f * ss->steps[draggedStep])); } if (yTop > sr.getHeight() / 2) @@ -973,9 +973,13 @@ void CLFOGui::drawStepSeq(VSTGUI::CDrawContext *dc, VSTGUI::CRect &maindisp, VST CRect labelR(dragX, dragY, dragX + dragW, dragY + dragH); - fillr(labelR, skin->getColor("lfo.stepseq.popup.border", kBlackCColor)); + auto iwbrc = skin->getColor( "infowindow.border", kBlackCColor ); + auto iwbgc = skin->getColor( "infowindow.background", kWhiteCColor ); + auto iwfgc = skin->getColor( "infowindow.foreground", kBlackCColor ); + + fillr(labelR, skin->getColor("lfo.stepseq.popup.border", iwbrc)); labelR.inset(1, 1); - fillr(labelR, skin->getColor("lfo.stepseq.popup.background", kWhiteCColor)); + fillr(labelR, skin->getColor("lfo.stepseq.popup.background", iwbgc )); labelR.left += 1; labelR.top -= (keyModMult > 0 ? 9 : 0); @@ -983,7 +987,7 @@ void CLFOGui::drawStepSeq(VSTGUI::CDrawContext *dc, VSTGUI::CRect &maindisp, VST char txt[256]; sprintf(txt, "%.*f %%", prec, ss->steps[draggedStep] * 100.f); - dc->setFontColor(skin->getColor("lfo.stepseq.popup.foreground", kBlackCColor)); + dc->setFontColor(skin->getColor("lfo.stepseq.popup.foreground", iwfgc ) ); dc->setFont(lfoTypeFont); dc->drawString(txt, labelR, VSTGUI::kLeftText, true); diff --git a/src/common/gui/CParameterTooltip.h b/src/common/gui/CParameterTooltip.h index 62f246e7136..1673118e48a 100644 --- a/src/common/gui/CParameterTooltip.h +++ b/src/common/gui/CParameterTooltip.h @@ -5,9 +5,9 @@ #include "vstcontrols.h" #include "Parameter.h" #include -#include "UserDefaults.h" +#include "SkinSupport.h" -class CParameterTooltip : public VSTGUI::CControl +class CParameterTooltip : public VSTGUI::CControl, public Surge::UI::SkinConsumingComponnt { public: CParameterTooltip(const VSTGUI::CRect& size) : VSTGUI::CControl(size, 0, 0, 0) @@ -69,34 +69,30 @@ class CParameterTooltip : public VSTGUI::CControl { if (visible) { - // COffscreenContext *dc = - // COffscreenContext::create(getFrame(),size.width(),size.height()); + dc->setFont(VSTGUI::kNormalFontSmall); - dc->setFont(VSTGUI::kNormalFontSmall); - - VSTGUI::CRect smaller = getViewSize(); - int shrink = 0; - /*if(!label[0][0]) - { - int width = dc->getStringWidth(label[1]); - shrink = limit_range(150 - width,0,75); - - } - //smaller.inset(shrink>>1,0);' - smaller.x += shrink;*/ + auto frameCol = skin->getColor( "infowindow.border", VSTGUI::kBlackCColor ); + auto bgCol = skin->getColor( "infowindow.background", VSTGUI::kWhiteCColor ); + auto txtCol = skin->getColor( "infowindow.foreground", VSTGUI::kBlackCColor ); + auto mpCol = skin->getColor( "infowindow.foreground.modulationpositive", txtCol ); + auto mnCol = skin->getColor( "infowindow.foreground.modulationnegative", txtCol ); + auto mpValCol = skin->getColor( "infowindow.foreground.modulationvaluepositive", mpCol ); + auto mnValCol = skin->getColor( "infowindow.foreground.modulationvaluenegative", mnCol ); + + + auto size = getViewSize(); size = size.inset(0.75, 0.75); - dc->setFrameColor(VSTGUI::kBlackCColor); + dc->setFrameColor(frameCol); dc->drawRect(size); VSTGUI::CRect sizem1(size); sizem1.inset(1, 1); - dc->setFillColor(VSTGUI::kWhiteCColor); + dc->setFillColor(bgCol); dc->drawRect(sizem1, VSTGUI::kDrawFilled); - dc->setFontColor(VSTGUI::kBlackCColor); + dc->setFontColor(txtCol); VSTGUI::CRect trect(size); trect.inset(4, 1); - trect.right -= shrink; VSTGUI::CRect tupper(trect), tlower(trect); tupper.bottom = tupper.top + 13; tlower.top = tlower.bottom - 15; @@ -118,16 +114,23 @@ class CParameterTooltip : public VSTGUI::CControl if( ! extendedwsstrings ) { dc->drawString( iwstrings.val.c_str(), tmid, VSTGUI::kLeftText, true ); + dc->setFontColor( mpCol ); dc->drawString( iwstrings.dvalplus.c_str(), tmid, VSTGUI::kRightText, true ); + dc->setFontColor( txtCol ); } else { dc->drawString( iwstrings.val.c_str(), tmid, VSTGUI::kCenterText, true ); + dc->setFontColor( mpCol ); dc->drawString( iwstrings.dvalplus.c_str(), tmid, VSTGUI::kRightText, true ); + dc->setFontColor( mnCol ); dc->drawString( iwstrings.dvalminus.c_str(), tmid, VSTGUI::kLeftText, true ); - + + dc->setFontColor( mpValCol ); dc->drawString( iwstrings.valplus.c_str(), tlower, VSTGUI::kRightText, true ); + dc->setFontColor( mnValCol ); dc->drawString( iwstrings.valminus.c_str(), tlower, VSTGUI::kLeftText, true ); + dc->setFontColor( txtCol ); } } else @@ -144,8 +147,6 @@ class CParameterTooltip : public VSTGUI::CControl dc->drawString(label2left, tlower, VSTGUI::kLeftText, true); } } - // dc->copyFrom(dc1,smaller); - // dc->forget(); } setDirty(false); } diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 2aff99ae09b..7030aa43352 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -1974,6 +1974,7 @@ void SurgeGUIEditor::openOrRecreateEditor() frame->addView(b_settingsMenu); infowindow = new CParameterTooltip(CRect(0, 0, 0, 0)); + ((CParameterTooltip *)infowindow)->setSkin( currentSkin ); frame->addView(infowindow); CRect wsize(0, 0, WINDOW_SIZE_X, WINDOW_SIZE_Y);