Skip to content

Commit e574542

Browse files
committed
CapabilityInquiryDemo: Adapt UI layout to narrow screens
1 parent 6a53ddc commit e574542

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/Audio/CapabilityInquiryDemo.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3713,11 +3713,15 @@ class CapabilityInquiryDemo : public Component,
37133713

37143714
void resized() override
37153715
{
3716-
tabs.setBounds (getLocalBounds());
3716+
auto bounds = getLocalBounds();
3717+
auto buttonStrip = bounds.getWidth() < 650 ? bounds.removeFromTop (tabs.getTabBarDepth())
3718+
: getLocalBounds().removeFromTop (tabs.getTabBarDepth());
3719+
3720+
tabs.setBounds (bounds);
37173721

3718-
const auto buttonBounds = getLocalBounds().removeFromTop (tabs.getTabBarDepth())
3719-
.removeFromRight (300)
3720-
.reduced (2);
3722+
const auto buttonBounds = buttonStrip.removeFromTop (tabs.getTabBarDepth())
3723+
.removeFromRight (300)
3724+
.reduced (2);
37213725
Utils::doColumnLayout (buttonBounds, loadButton, saveButton);
37223726
}
37233727

0 commit comments

Comments
 (0)