Browse Source

Reduce the list row height in AudioDeviceSelectorComponent when the item height is reduced

tags/2021-05-28
ed 7 years ago
parent
commit
0ab5e696fe
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp

+ 5
- 2
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -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);


Loading…
Cancel
Save