diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index 918c76a5e5..fd437f382e 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -291,22 +291,28 @@ public: r.removeFromTop (space); } - r.removeFromTop (space * 2); - Rectangle buttons (r.removeFromTop (h)); + r.removeFromTop (space); - if (showUIButton != nullptr) + if (showUIButton != nullptr || resetDeviceButton != nullptr) { - showUIButton->setVisible (advancedSettingsVisible); - showUIButton->changeWidthToFitText (h); - showUIButton->setBounds (buttons.removeFromLeft (showUIButton->getWidth())); - buttons.removeFromLeft (space); - } + Rectangle buttons (r.removeFromTop (h)); - if (resetDeviceButton != nullptr) - { - resetDeviceButton->setVisible (advancedSettingsVisible); - resetDeviceButton->changeWidthToFitText (h); - resetDeviceButton->setBounds (buttons.removeFromLeft (showUIButton->getWidth())); + if (showUIButton != nullptr) + { + showUIButton->setVisible (advancedSettingsVisible); + showUIButton->changeWidthToFitText (h); + showUIButton->setBounds (buttons.removeFromLeft (showUIButton->getWidth())); + buttons.removeFromLeft (space); + } + + if (resetDeviceButton != nullptr) + { + resetDeviceButton->setVisible (advancedSettingsVisible); + resetDeviceButton->changeWidthToFitText (h); + resetDeviceButton->setBounds (buttons.removeFromLeft (resetDeviceButton->getWidth())); + } + + r.removeFromTop (space); } setSize (getWidth(), r.getY());