diff --git a/src/surge-xt/gui/overlays/OverlayWrapper.cpp b/src/surge-xt/gui/overlays/OverlayWrapper.cpp index ac60cfc4f00..d73ac78e9be 100644 --- a/src/surge-xt/gui/overlays/OverlayWrapper.cpp +++ b/src/surge-xt/gui/overlays/OverlayWrapper.cpp @@ -27,14 +27,14 @@ namespace Overlays { OverlayWrapper::OverlayWrapper() { - closeButton = std::make_unique("closeButton"); + closeButton.reset( + getLookAndFeel().createDocumentWindowButton(juce::DocumentWindow::closeButton)); closeButton->addListener(this); - closeButton->setButtonText("X"); addChildComponent(*closeButton); - tearOutButton = std::make_unique("tearOut"); + tearOutButton.reset( + getLookAndFeel().createDocumentWindowButton(juce::DocumentWindow::maximiseButton)); tearOutButton->addListener(this); - tearOutButton->setButtonText("^"); addChildComponent(*tearOutButton); } @@ -86,7 +86,7 @@ void OverlayWrapper::addAndTakeOwnership(std::unique_ptr c) primaryChild = std::move(c); primaryChild->setBounds(q); - auto buttonSize = titlebarSize - 2; + auto buttonSize = titlebarSize; auto closeButtonBounds = getLocalBounds().withHeight(buttonSize).withLeft(getWidth() - buttonSize).translated(-2, 2); auto tearOutButtonBounds = closeButtonBounds.translated(-buttonSize - 2, 0); diff --git a/src/surge-xt/gui/overlays/OverlayWrapper.h b/src/surge-xt/gui/overlays/OverlayWrapper.h index 546ce24733b..f794e16bd8f 100644 --- a/src/surge-xt/gui/overlays/OverlayWrapper.h +++ b/src/surge-xt/gui/overlays/OverlayWrapper.h @@ -53,7 +53,7 @@ struct OverlayWrapper : public juce::Component, std::unique_ptr primaryChild; void addAndTakeOwnership(std::unique_ptr c); - std::unique_ptr closeButton, tearOutButton; + std::unique_ptr closeButton, tearOutButton; void buttonClicked(juce::Button *button) override; juce::Point mouseDownWithinTarget; diff --git a/src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp b/src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp index 4e4de6072de..f3e95309d78 100644 --- a/src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp +++ b/src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp @@ -1206,7 +1206,9 @@ void LFOAndStepDisplay::setStepValue(const juce::MouseEvent &event) { auto r = steprect[i]; - if (r.contains(event.position)) + float rx0 = r.getX(); + float rx1 = r.getX() + r.getWidth(); + if (event.position.x >= rx0 && event.position.x < rx1) { draggedStep = i;