Skip to content

Commit

Permalink
A collection of beta fixes (#5460)
Browse files Browse the repository at this point in the history
1. Tune button blinks because it uses legacy state from toggle.
   Closes #5459
2. Allow drag outside of SS to reset values. Closes #5455
3. Use JUCE documetn buttons on overlay popout/close. Closes #5453
  • Loading branch information
baconpaul authored Nov 24, 2021
1 parent 6df105b commit 6f95a0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/surge-xt/gui/overlays/OverlayWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ namespace Overlays
{
OverlayWrapper::OverlayWrapper()
{
closeButton = std::make_unique<juce::TextButton>("closeButton");
closeButton.reset(
getLookAndFeel().createDocumentWindowButton(juce::DocumentWindow::closeButton));
closeButton->addListener(this);
closeButton->setButtonText("X");
addChildComponent(*closeButton);

tearOutButton = std::make_unique<juce::TextButton>("tearOut");
tearOutButton.reset(
getLookAndFeel().createDocumentWindowButton(juce::DocumentWindow::maximiseButton));
tearOutButton->addListener(this);
tearOutButton->setButtonText("^");
addChildComponent(*tearOutButton);
}

Expand Down Expand Up @@ -86,7 +86,7 @@ void OverlayWrapper::addAndTakeOwnership(std::unique_ptr<juce::Component> 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);
Expand Down
2 changes: 1 addition & 1 deletion src/surge-xt/gui/overlays/OverlayWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct OverlayWrapper : public juce::Component,

std::unique_ptr<juce::Component> primaryChild;
void addAndTakeOwnership(std::unique_ptr<juce::Component> c);
std::unique_ptr<juce::TextButton> closeButton, tearOutButton;
std::unique_ptr<juce::Button> closeButton, tearOutButton;
void buttonClicked(juce::Button *button) override;

juce::Point<int> mouseDownWithinTarget;
Expand Down
4 changes: 3 additions & 1 deletion src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6f95a0f

Please sign in to comment.