Skip to content

Commit 29bfbe6

Browse files
committed
Show audio controls in welcome panel
1 parent 91aee41 commit 29bfbe6

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

Source/LookAndFeel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ void PlugDataLook::fillResizableWindowBackground(Graphics& g, int w, int h, Bord
102102

103103
void PlugDataLook::drawCallOutBoxBackground(CallOutBox& box, Graphics& g, Path const& path, Image& cachedImage)
104104
{
105-
106105
if (!ProjectInfo::canUseSemiTransparentWindows()) {
107106
auto const bounds = path.getBounds();
108107
g.setColour(PlugDataColours::popupMenuBackgroundColour);

Source/PluginEditor.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,6 @@ PluginEditor::PluginEditor(PluginProcessor& p)
189189

190190
setOpaque(false);
191191

192-
for (auto* button : SmallArray<MainToolbarButton*> {
193-
&mainMenuButton,
194-
&undoButton,
195-
&redoButton,
196-
&addObjectMenuButton,
197-
&welcomePanelSearchButton
198-
}) {
199-
addChildComponent(button);
200-
}
201-
202192
// Show settings
203193
mainMenuButton.setTooltip("Main menu");
204194
mainMenuButton.onClick = [this] {
@@ -245,8 +235,6 @@ PluginEditor::PluginEditor(PluginProcessor& p)
245235

246236
sidebar->setSize(250, pd->lastUIHeight);
247237

248-
setSize(pd->lastUIWidth, pd->lastUIHeight);
249-
250238
sidebar->toFront(false);
251239

252240
// Make sure existing console messages are processed
@@ -276,6 +264,17 @@ PluginEditor::PluginEditor(PluginProcessor& p)
276264
audioToolbar->setAlwaysOnTop(true);
277265
addAndMakeVisible(audioToolbar.get());
278266

267+
for (auto* button : SmallArray<MainToolbarButton*> {
268+
&mainMenuButton,
269+
&undoButton,
270+
&redoButton,
271+
&addObjectMenuButton,
272+
&welcomePanelSearchButton
273+
}) {
274+
addChildComponent(button);
275+
}
276+
setSize(pd->lastUIWidth, pd->lastUIHeight);
277+
279278
#if ENABLE_TESTING
280279
// Call after window is ready
281280
::Timer::callAfterDelay(200, [this]() {
@@ -503,7 +502,6 @@ void PluginEditor::showWelcomePanel(bool const shouldShow)
503502
undoButton.setVisible(!shouldShow);
504503
redoButton.setVisible(!shouldShow);
505504
sidebar->setVisible(!shouldShow);
506-
audioToolbar->setVisible(!shouldShow);
507505

508506
welcomePanelSearchButton.setVisible(shouldShow);
509507
recentlyOpenedPanelSelector.setVisible(shouldShow);
@@ -607,7 +605,8 @@ void PluginEditor::resized()
607605
auto statusbarBounds = getLocalBounds().removeFromBottom(48).withSizeKeepingCentre(204, 48).translated(0, -12);
608606
if(statusbar) statusbar->setBounds(statusbarBounds);
609607

610-
if(audioToolbar) audioToolbar->setBounds(getLocalBounds().removeFromTop(toolbarHeight).removeFromRight(500).translated(-windowControlsOffset, 2));
608+
auto audioToolbarWidth = welcomePanelSearchButton.isVisible() ? 210 : 500;
609+
if(audioToolbar) audioToolbar->setBounds(getLocalBounds().removeFromTop(toolbarHeight).removeFromRight(audioToolbarWidth).translated(-windowControlsOffset, 2));
611610

612611
auto welcomeSelectorBounds = getLocalBounds().removeFromTop(toolbarHeight + 8).withSizeKeepingCentre(200, toolbarHeight).translated(0, -1);
613612
recentlyOpenedPanelSelector.setBounds(welcomeSelectorBounds.removeFromLeft(100));
@@ -622,7 +621,7 @@ void PluginEditor::resized()
622621
resizerSize, resizerSize);
623622
}
624623

625-
welcomePanelSearchButton.setBounds(getWidth() - (windowControlsOffset + 40.f), 0, buttonSize, buttonSize);
624+
welcomePanelSearchButton.setBounds(audioToolbar->getX() - buttonSize + 12, 0, buttonSize, buttonSize);
626625

627626
welcomePanelSearchInput.setBounds(libraryPanelSelector.getRight() + 10, 4, welcomePanelSearchButton.getX() - libraryPanelSelector.getRight() - 20, toolbarHeight - 4);
628627

0 commit comments

Comments
 (0)