From 0ab5e696fef54fc7c70733100a785ee7fefe6dad Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 25 Jan 2019 12:02:04 +0000 Subject: [PATCH] Reduce the list row height in AudioDeviceSelectorComponent when the item height is reduced --- .../gui/juce_AudioDeviceSelectorComponent.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index 24267c109d..379e1afc0e 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -146,7 +146,7 @@ public: if (items.isEmpty()) { g.setColour (Colours::grey); - g.setFont (13.0f); + g.setFont (0.5f * getRowHeight()); g.drawText (noItemsMessage, 0, 0, getWidth(), getHeight() / 2, Justification::centred, true); @@ -260,6 +260,7 @@ public: if (outputChanList != nullptr) { + outputChanList->setRowHeight (jmin (22, h)); outputChanList->setBounds (r.removeFromTop (outputChanList->getBestHeight (maxListBoxHeight))); outputChanLabel->setBounds (0, outputChanList->getBounds().getCentreY() - h / 2, r.getX(), h); r.removeFromTop (space); @@ -267,6 +268,7 @@ public: if (inputChanList != nullptr) { + inputChanList->setRowHeight (jmin (22, h)); inputChanList->setBounds (r.removeFromTop (inputChanList->getBestHeight (maxListBoxHeight))); inputChanLabel->setBounds (0, inputChanList->getBounds().getCentreY() - h / 2, r.getX(), h); r.removeFromTop (space); @@ -823,7 +825,7 @@ public: if (items.isEmpty()) { g.setColour (Colours::grey); - g.setFont (13.0f); + g.setFont (0.5f * getRowHeight()); g.drawText (noItemsMessage, 0, 0, getWidth(), getHeight() / 2, Justification::centred, true); @@ -1060,6 +1062,7 @@ void AudioDeviceSelectorComponent::resized() if (midiInputsList != nullptr) { + midiInputsList->setRowHeight (jmin (22, itemHeight)); midiInputsList->setBounds (r.removeFromTop (midiInputsList->getBestHeight (jmin (itemHeight * 8, getHeight() - r.getY() - space - itemHeight)))); r.removeFromTop (space);