From aef09a4d5b29c412e0c1e0b616a682e2c95ea7e3 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 14 Jul 2014 12:20:18 +0100 Subject: [PATCH] Minor layout tweaks to the AudioDeviceSelectorComponent --- .../gui/juce_AudioDeviceSelectorComponent.cpp | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) 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());