Skip to content

Commit

Permalink
Merge branch 'development-juce8' of https://github.com/open-ephys/plu…
Browse files Browse the repository at this point in the history
…gin-GUI into development-juce8
  • Loading branch information
jsiegle committed Oct 11, 2024
2 parents b2ec7fb + df3a0e3 commit 7e13d97
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Source/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ MainWindow::MainWindow (const File& fileToLoad, bool isConsoleApp_) : isConsoleA
documentWindow->setUsingNativeTitleBar (true); // Use native title bar on Mac and Linux
#endif

documentWindow->addToDesktop (documentWindow->getDesktopWindowStyleFlags()); // prevents the maximize
// button from randomly disappearing
documentWindow->addToDesktop();
documentWindow->setVisible (true);
documentWindow->toFront (true);

// Constraining the window's size doesn't seem to work:
documentWindow->setResizeLimits (800, 600, 10000, 10000);
Expand Down
8 changes: 7 additions & 1 deletion Source/Processors/AudioNode/AudioEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ AudioWindowButton::AudioWindowButton()

void AudioWindowButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDown)
{
float alpha = isMouseOver ? 0.6f : 1.0f;
float alpha = (isMouseOver && getClickingTogglesState()) ? 0.6f : 1.0f;

if (getToggleState())
g.setColour (Colours::yellow.withAlpha (alpha));
Expand Down Expand Up @@ -203,6 +203,7 @@ void AudioEditor::buttonClicked (Button* button)
AccessClass::getAudioComponent()->restartDevice();
audioConfigurationWindow->setLookAndFeel (&getLookAndFeel());
audioConfigurationWindow->setVisible (true);
audioConfigurationWindow->toFront (true);
}
else
{
Expand Down Expand Up @@ -293,6 +294,11 @@ AudioConfigurationWindow::AudioConfigurationWindow (AudioDeviceManager& adm, Aud

setContentOwned (adsc, true);
setVisible (false);

int fixedWidth = adsc->getWidth() + 10;
int fixedHeight = adsc->getHeight() + getTitleBarHeight() + 20;

setResizeLimits (fixedWidth, fixedHeight, fixedWidth, fixedHeight);
}

void AudioConfigurationWindow::closeButtonPressed()
Expand Down
9 changes: 6 additions & 3 deletions Source/Processors/Editors/GenericEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ void UtilityButton::setCorners (bool UL, bool UR, bool LL, bool LR)
void UtilityButton::setEnabledState (bool state)
{
isEnabled = state;
setEnabled (state);

repaint();
}
Expand All @@ -865,6 +866,8 @@ void UtilityButton::setRadius (float r)

void UtilityButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDown)
{
isEnabled = Button::isEnabled();

if (getToggleState())
{
g.setColour (findColour (ThemeColours::highlightedFill));
Expand All @@ -887,10 +890,10 @@ void UtilityButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDow

g.setFont (font);

if (isEnabled || ! isButtonDown)
g.setColour (findColour (ThemeColours::defaultText));
else
if (! isEnabled || isButtonDown)
g.setColour (findColour (ThemeColours::defaultText).withAlpha (0.4f));
else
g.setColour (findColour (ThemeColours::defaultText));

g.drawFittedText (label, 1, 1, getWidth() - 2, getHeight() - 2, Justification::centred, 2, 1.0f);
}
Expand Down

0 comments on commit 7e13d97

Please sign in to comment.