kopia lustrzana https://github.com/jameshball/osci-render
Move settings cog to title bar
rodzic
558bd0011d
commit
212d518fd0
|
@ -186,6 +186,7 @@
|
||||||
if (visualiserOnly) {
|
if (visualiserOnly) {
|
||||||
popout.remove();
|
popout.remove();
|
||||||
fullscreen.remove();
|
fullscreen.remove();
|
||||||
|
settings.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -12,17 +12,8 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p)
|
||||||
|
|
||||||
setLookAndFeel(&lookAndFeel);
|
setLookAndFeel(&lookAndFeel);
|
||||||
|
|
||||||
#if JUCE_MAC
|
menuBar.setModel(&menuBarModel);
|
||||||
if (audioProcessor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone) {
|
addAndMakeVisible(menuBar);
|
||||||
usingNativeMenuBar = true;
|
|
||||||
menuBarModel.setMacMainMenu(&menuBarModel);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!usingNativeMenuBar) {
|
|
||||||
menuBar.setModel(&menuBarModel);
|
|
||||||
addAndMakeVisible(menuBar);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (juce::JUCEApplicationBase::isStandaloneApp()) {
|
if (juce::JUCEApplicationBase::isStandaloneApp()) {
|
||||||
if (juce::TopLevelWindow::getNumTopLevelWindows() > 0) {
|
if (juce::TopLevelWindow::getNumTopLevelWindows() > 0) {
|
||||||
|
@ -42,11 +33,16 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAndMakeVisible(settings);
|
||||||
|
|
||||||
|
settings.onClick = [this] {
|
||||||
|
openVisualiserSettings();
|
||||||
|
};
|
||||||
|
|
||||||
addAndMakeVisible(visualiser);
|
addAndMakeVisible(visualiser);
|
||||||
|
|
||||||
visualiser.openSettings = [this] {
|
visualiser.openSettings = [this] {
|
||||||
visualiserSettingsWindow.setVisible(true);
|
openVisualiserSettings();
|
||||||
visualiserSettingsWindow.toFront(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
visualiser.closeSettings = [this] {
|
visualiser.closeSettings = [this] {
|
||||||
|
@ -73,24 +69,18 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p)
|
||||||
SosciPluginEditor::~SosciPluginEditor() {
|
SosciPluginEditor::~SosciPluginEditor() {
|
||||||
setLookAndFeel(nullptr);
|
setLookAndFeel(nullptr);
|
||||||
juce::Desktop::getInstance().setDefaultLookAndFeel(nullptr);
|
juce::Desktop::getInstance().setDefaultLookAndFeel(nullptr);
|
||||||
|
|
||||||
#if JUCE_MAC
|
|
||||||
if (usingNativeMenuBar) {
|
|
||||||
menuBarModel.setMacMainMenu(nullptr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SosciPluginEditor::paint(juce::Graphics& g) {
|
void SosciPluginEditor::paint(juce::Graphics& g) {
|
||||||
g.fillAll(getLookAndFeel().findColour(juce::ResizableWindow::backgroundColourId));
|
g.fillAll(Colours::veryDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SosciPluginEditor::resized() {
|
void SosciPluginEditor::resized() {
|
||||||
auto area = getLocalBounds();
|
auto area = getLocalBounds();
|
||||||
|
|
||||||
if (!usingNativeMenuBar) {
|
auto topBar = area.removeFromTop(25);
|
||||||
menuBar.setBounds(area.removeFromTop(25));
|
settings.setBounds(topBar.removeFromRight(25));
|
||||||
}
|
menuBar.setBounds(topBar);
|
||||||
|
|
||||||
visualiser.setBounds(area);
|
visualiser.setBounds(area);
|
||||||
}
|
}
|
||||||
|
@ -171,3 +161,8 @@ void SosciPluginEditor::resetToDefault() {
|
||||||
window->resetToDefaultState();
|
window->resetToDefaultState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SosciPluginEditor::openVisualiserSettings() {
|
||||||
|
visualiserSettingsWindow.setVisible(true);
|
||||||
|
visualiserSettingsWindow.toFront(true);
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "LookAndFeel.h"
|
#include "LookAndFeel.h"
|
||||||
#include "components/VisualiserSettings.h"
|
#include "components/VisualiserSettings.h"
|
||||||
#include "components/SosciMainMenuBarModel.h"
|
#include "components/SosciMainMenuBarModel.h"
|
||||||
|
#include "components/SvgButton.h"
|
||||||
|
|
||||||
class SosciPluginEditor : public juce::AudioProcessorEditor {
|
class SosciPluginEditor : public juce::AudioProcessorEditor {
|
||||||
public:
|
public:
|
||||||
|
@ -21,6 +22,7 @@ public:
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
void openAudioSettings();
|
void openAudioSettings();
|
||||||
void resetToDefault();
|
void resetToDefault();
|
||||||
|
void openVisualiserSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SosciAudioProcessor& audioProcessor;
|
SosciAudioProcessor& audioProcessor;
|
||||||
|
@ -36,6 +38,8 @@ public:
|
||||||
juce::MenuBarComponent menuBar;
|
juce::MenuBarComponent menuBar;
|
||||||
|
|
||||||
juce::TooltipWindow tooltipWindow{nullptr, 0};
|
juce::TooltipWindow tooltipWindow{nullptr, 0};
|
||||||
|
|
||||||
|
SvgButton settings{"Settings", BinaryData::cog_svg, juce::Colours::white, juce::Colours::white};
|
||||||
|
|
||||||
bool usingNativeMenuBar = false;
|
bool usingNativeMenuBar = false;
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@
|
||||||
file="Source/components/SosciMainMenuBarModel.cpp"/>
|
file="Source/components/SosciMainMenuBarModel.cpp"/>
|
||||||
<FILE id="EymEr3" name="SosciMainMenuBarModel.h" compile="0" resource="0"
|
<FILE id="EymEr3" name="SosciMainMenuBarModel.h" compile="0" resource="0"
|
||||||
file="Source/components/SosciMainMenuBarModel.h"/>
|
file="Source/components/SosciMainMenuBarModel.h"/>
|
||||||
|
<FILE id="f2kkHV" name="SvgButton.h" compile="0" resource="0" file="Source/components/SvgButton.h"/>
|
||||||
<FILE id="qzfstC" name="SwitchButton.h" compile="0" resource="0" file="Source/components/SwitchButton.h"/>
|
<FILE id="qzfstC" name="SwitchButton.h" compile="0" resource="0" file="Source/components/SwitchButton.h"/>
|
||||||
<FILE id="y3UiR0" name="VisualiserComponent.cpp" compile="1" resource="0"
|
<FILE id="y3UiR0" name="VisualiserComponent.cpp" compile="1" resource="0"
|
||||||
file="Source/components/VisualiserComponent.cpp"/>
|
file="Source/components/VisualiserComponent.cpp"/>
|
||||||
|
|
Ładowanie…
Reference in New Issue