| @@ -9,9 +9,9 @@ | |||
| //============================================================================== | |||
| class AUv3SynthEditor : public AudioProcessorEditor, | |||
| public ButtonListener, | |||
| public Slider::Listener, | |||
| private Timer | |||
| public ButtonListener, | |||
| public Slider::Listener, | |||
| private Timer | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| @@ -9,7 +9,7 @@ | |||
| #include "../JuceLibraryCode/JuceHeader.h" | |||
| //============================================================================== | |||
| class MaterialLookAndFeel : public LookAndFeel_V3 | |||
| class MaterialLookAndFeel : public LookAndFeel_V4 | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| @@ -24,16 +24,10 @@ public: | |||
| void drawButtonBackground (Graphics& g, | |||
| Button& button, | |||
| const Colour& /*backgroundColour*/, | |||
| bool isMouseOverButton, | |||
| bool /*isMouseOverButton*/, | |||
| bool isButtonDown) override | |||
| { | |||
| ignoreUnused (isMouseOverButton); | |||
| const int width = button.getWidth(); | |||
| const int height = button.getHeight(); | |||
| Rectangle<float> buttonRect (0, 0, width, height); | |||
| buttonRect.reduce (haloRadius, 0.0f); | |||
| const auto buttonRect = button.getLocalBounds().toFloat(); | |||
| if (isButtonDown) | |||
| g.setColour (brightButtonColour.withAlpha (0.7f)); | |||
| @@ -58,7 +52,7 @@ public: | |||
| else | |||
| g.setColour (backgroundColour); | |||
| g.drawFittedText (button.getButtonText(), 0, 1, | |||
| g.drawFittedText (button.getButtonText(), 0, 0, | |||
| button.getWidth(), | |||
| button.getHeight(), | |||
| Justification::centred, 2); | |||
| @@ -62,7 +62,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -32,9 +32,9 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (Colours::black); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| g.setColour (Colours::white); | |||
| g.setColour (getLookAndFeel().findColour (Slider::thumbColourId)); | |||
| const int fishLength = 15; | |||
| Path spinePath; | |||
| @@ -62,7 +62,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -76,7 +76,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (Colours::black); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| const float centreY = getHeight() / 2.0f; | |||
| const float radius = amplitude * 200.0f; | |||
| @@ -95,7 +95,7 @@ public: | |||
| wavePath.lineTo (x, centreY + amplitude * getHeight() * 2.0f | |||
| * std::sin (x * frequency * 0.0001f)); | |||
| g.setColour (Colours::grey); | |||
| g.setColour (getLookAndFeel().findColour (Slider::thumbColourId)); | |||
| g.strokePath (wavePath, PathStrokeType (2.0f)); | |||
| } | |||
| @@ -21,7 +21,7 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| getLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -148,7 +148,6 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::lightgrey); | |||
| } | |||
| void resized() override | |||
| @@ -21,7 +21,7 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| getLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -46,7 +46,6 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::lightgrey); | |||
| } | |||
| void resized() override | |||
| @@ -20,7 +20,7 @@ public: | |||
| struct MainWindow : public DocumentWindow | |||
| { | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -100,7 +100,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::lightgrey); | |||
| g.setColour (getLookAndFeel().findColour (Label::textColourId)); | |||
| g.drawText ("Connect a Lightpad Block to play.", | |||
| getLocalBounds(), Justification::centred, false); | |||
| } | |||
| @@ -58,7 +58,10 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (const String& name) | |||
| : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons) | |||
| : DocumentWindow (name, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| setContentOwned (createMainContentComponent(), true); | |||
| @@ -84,7 +84,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (Colours::black); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| Point<float> nextPos = pos + delta; | |||
| @@ -111,7 +111,7 @@ public: | |||
| } | |||
| // draw a circle | |||
| g.setColour (Colours::grey); | |||
| g.setColour (getLookAndFeel().findColour (Slider::thumbColourId)); | |||
| g.fillEllipse (pos.x, pos.y, 20, 20); | |||
| drawWaveform (g, 20.0f, 0); | |||
| @@ -62,7 +62,7 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -25,7 +25,6 @@ MainContentComponent::~MainContentComponent() | |||
| void MainContentComponent::paint (Graphics& g) | |||
| { | |||
| g.fillAll (Colour (0xff001F36)); | |||
| } | |||
| void MainContentComponent::resized() | |||
| @@ -24,12 +24,10 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::black); | |||
| // Only shows the red ellipse when the button is on. | |||
| if (isOn) | |||
| { | |||
| g.setColour (Colours::red); | |||
| g.setColour (getLookAndFeel().findColour (Slider::thumbColourId)); | |||
| g.fillEllipse (getLocalBounds().toFloat()); | |||
| } | |||
| } | |||
| @@ -39,10 +39,12 @@ inline Colour getRandomColour (float brightness) | |||
| inline Colour getRandomBrightColour() { return getRandomColour (0.8f); } | |||
| inline Colour getRandomDarkColour() { return getRandomColour (0.3f); } | |||
| inline void fillStandardDemoBackground (Graphics& g) | |||
| inline Colour getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour uiColour, Colour fallback = Colour (0xff4d4d4d)) | |||
| { | |||
| g.setColour (Colour (0xff4d4d4d)); | |||
| g.fillAll(); | |||
| if (auto* v4 = dynamic_cast<LookAndFeel_V4*> (&LookAndFeel::getDefaultLookAndFeel())) | |||
| return v4->getCurrentColourScheme().getUIColour (uiColour); | |||
| return fallback; | |||
| } | |||
| //============================================================================== | |||
| @@ -44,7 +44,7 @@ public: | |||
| s.setJustification (Justification::centred); | |||
| s.setWordWrap (AttributedString::none); | |||
| s.append ("Drag Me!"); | |||
| s.setColour (Colours::white); | |||
| s.setColour (findColour (TextButton::textColourOffId)); | |||
| s.draw (g, area); | |||
| } | |||
| @@ -168,7 +168,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| private: | |||
| @@ -305,9 +305,13 @@ public: | |||
| resultsBox.setScrollbarsShown (true); | |||
| resultsBox.setCaretVisible (false); | |||
| resultsBox.setPopupMenuEnabled (true); | |||
| resultsBox.setColour (TextEditor::backgroundColourId, Colour (0x32ffffff)); | |||
| resultsBox.setColour (TextEditor::backgroundColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::widgetBackground, | |||
| Colour (0x32ffffff))); | |||
| resultsBox.setColour (TextEditor::outlineColourId, Colour (0x1c000000)); | |||
| resultsBox.setColour (TextEditor::shadowColourId, Colour (0x16000000)); | |||
| resultsBox.setText ("Running this test measures the round-trip latency between the audio output and input " | |||
| "devices you\'ve got selected.\n\n" | |||
| "It\'ll play a sound, then try to measure the time at which the sound arrives " | |||
| @@ -339,7 +343,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -273,6 +273,7 @@ public: | |||
| startStopButton.setButtonText ("Play/Stop"); | |||
| startStopButton.addListener (this); | |||
| startStopButton.setColour (TextButton::buttonColourId, Colour (0xff79ed7f)); | |||
| startStopButton.setColour (TextButton::textColourOffId, Colours::black); | |||
| addAndMakeVisible (fileTreeComp); | |||
| @@ -305,7 +306,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -247,7 +247,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -44,10 +44,6 @@ public: | |||
| diagnosticsBox.setScrollbarsShown (true); | |||
| diagnosticsBox.setCaretVisible (false); | |||
| diagnosticsBox.setPopupMenuEnabled (true); | |||
| diagnosticsBox.setColour (TextEditor::textColourId, Colours::white); | |||
| diagnosticsBox.setColour (TextEditor::backgroundColourId, Colour (0x32ffffff)); | |||
| diagnosticsBox.setColour (TextEditor::outlineColourId, Colour (0x1c000000)); | |||
| diagnosticsBox.setColour (TextEditor::shadowColourId, Colour (0x16000000)); | |||
| MainAppWindow::getSharedAudioDeviceManager().addChangeListener (this); | |||
| @@ -62,7 +58,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -277,7 +277,7 @@ public: | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -30,49 +30,26 @@ inline float32 RandomFloat (float32 lo, float32 hi) { return Random::getSystemRa | |||
| struct Settings | |||
| { | |||
| Settings() | |||
| : viewCenter (0.0f, 20.0f), | |||
| hz (60.0f), | |||
| velocityIterations (8), | |||
| positionIterations (3), | |||
| drawShapes (1), | |||
| drawJoints (1), | |||
| drawAABBs (0), | |||
| drawPairs (0), | |||
| drawContactPoints (0), | |||
| drawContactNormals (0), | |||
| drawContactForces (0), | |||
| drawFrictionForces (0), | |||
| drawCOMs (0), | |||
| drawStats (0), | |||
| drawProfile (0), | |||
| enableWarmStarting (1), | |||
| enableContinuous (1), | |||
| enableSubStepping (0), | |||
| pause (0), | |||
| singleStep (0) | |||
| {} | |||
| b2Vec2 viewCenter; | |||
| float32 hz; | |||
| int velocityIterations; | |||
| int positionIterations; | |||
| int drawShapes; | |||
| int drawJoints; | |||
| int drawAABBs; | |||
| int drawPairs; | |||
| int drawContactPoints; | |||
| int drawContactNormals; | |||
| int drawContactForces; | |||
| int drawFrictionForces; | |||
| int drawCOMs; | |||
| int drawStats; | |||
| int drawProfile; | |||
| int enableWarmStarting; | |||
| int enableContinuous; | |||
| int enableSubStepping; | |||
| int pause; | |||
| int singleStep; | |||
| b2Vec2 viewCenter { 0.0f, 20.0f }; | |||
| float32 hz = 60.0f; | |||
| int velocityIterations = 8; | |||
| int positionIterations = 3; | |||
| int drawShapes = 1; | |||
| int drawJoints = 1; | |||
| int drawAABBs = 0; | |||
| int drawPairs = 0; | |||
| int drawContactPoints = 0; | |||
| int drawContactNormals = 0; | |||
| int drawContactForces = 0; | |||
| int drawFrictionForces = 0; | |||
| int drawCOMs = 0; | |||
| int drawStats = 0; | |||
| int drawProfile = 0; | |||
| int enableWarmStarting = 1; | |||
| int enableContinuous = 1; | |||
| int enableSubStepping = 0; | |||
| int pause = 0; | |||
| int singleStep = 0; | |||
| }; | |||
| struct Test | |||
| @@ -107,11 +84,14 @@ public: | |||
| void paintListBoxItem (int row, Graphics& g, int w, int h, bool rowIsSelected) override | |||
| { | |||
| auto& lf = LookAndFeel::getDefaultLookAndFeel(); | |||
| if (rowIsSelected) | |||
| g.fillAll (LookAndFeel::getDefaultLookAndFeel().findColour (TextEditor::highlightColourId)); | |||
| g.fillAll (Colour::contrasting (lf.findColour (ListBox::textColourId), | |||
| lf.findColour (ListBox::backgroundColourId))); | |||
| const Font f (h * 0.7f); | |||
| g.setColour (Colours::black); | |||
| g.setColour (lf.findColour (ListBox::textColourId)); | |||
| g.setFont (f); | |||
| g.drawText (tests[row], Rectangle<int> (0, 0, w, h).reduced (2), | |||
| Justification::centredLeft, true); | |||
| @@ -182,12 +162,10 @@ public: | |||
| addAndMakeVisible (testsListBox); | |||
| testsListBox.setModel (&testsListModel); | |||
| testsListBox.selectRow (dominoes); | |||
| testsListBox.setColour (ListBox::backgroundColourId, Colours::lightgrey); | |||
| addAndMakeVisible (instructions); | |||
| instructions.setMultiLine (true); | |||
| instructions.setReadOnly (true); | |||
| instructions.setColour (TextEditor::backgroundColourId, Colours::lightgrey); | |||
| startTimerHz (60); | |||
| } | |||
| @@ -199,14 +177,14 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| { | |||
| Rectangle<int> r (getLocalBounds().reduced (4)); | |||
| auto r = getLocalBounds().reduced (4); | |||
| Rectangle<int> area (r.removeFromBottom (150)); | |||
| auto area = r.removeFromBottom (150); | |||
| testsListBox.setBounds (area.removeFromLeft (150)); | |||
| area.removeFromLeft (4); | |||
| instructions.setBounds (area); | |||
| @@ -87,7 +87,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -61,7 +61,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::lightgrey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::lightgrey)); | |||
| } | |||
| void resized() override | |||
| @@ -48,7 +48,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| g.setColour (Colours::white); | |||
| g.setFont (15.0f); | |||
| @@ -33,8 +33,16 @@ public: | |||
| { | |||
| addAndMakeVisible (rsaGroup); | |||
| rsaGroup.setText ("RSA Encryption"); | |||
| rsaGroup.setColour (GroupComponent::outlineColourId, Colours::grey); | |||
| rsaGroup.setColour (GroupComponent::textColourId, Colours::white); | |||
| rsaGroup.setColour (GroupComponent::outlineColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::outline, | |||
| Colours::grey)); | |||
| rsaGroup.setColour (GroupComponent::textColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::white)); | |||
| rsaResultBox.setColour (TextEditor::backgroundColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::widgetBackground, | |||
| Colours::white.withAlpha (0.5f))); | |||
| bitSizeLabel.setText ("Num Bits to Use:", dontSendNotification); | |||
| bitSizeLabel.attachToComponent (&bitSize, true); | |||
| @@ -47,7 +55,6 @@ public: | |||
| generateRSAButton.addListener (this); | |||
| addAndMakeVisible (rsaResultBox); | |||
| rsaResultBox.setColour (TextEditor::backgroundColourId, Colours::white.withAlpha (0.5f)); | |||
| rsaResultBox.setReadOnly (true); | |||
| rsaResultBox.setMultiLine (true); | |||
| } | |||
| @@ -123,12 +130,19 @@ public: | |||
| { | |||
| addAndMakeVisible (hashGroup); | |||
| hashGroup.setText ("Hashes"); | |||
| hashGroup.setColour (GroupComponent::outlineColourId, Colours::grey); | |||
| hashGroup.setColour (GroupComponent::textColourId, Colours::white); | |||
| hashGroup.setColour (GroupComponent::outlineColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::outline, | |||
| Colours::grey)); | |||
| hashGroup.setColour (GroupComponent::textColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::white)); | |||
| hashEntryBox.setColour (TextEditor::backgroundColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::widgetBackground, | |||
| Colours::white.withAlpha (0.5f))); | |||
| addAndMakeVisible (hashEntryBox); | |||
| hashEntryBox.setMultiLine (true); | |||
| hashEntryBox.setColour (TextEditor::backgroundColourId, Colours::white.withAlpha (0.5f)); | |||
| hashEntryBox.setReturnKeyStartsNewLine (true); | |||
| hashEntryBox.setText ("Type some text in this box and the resulting MD5, SHA and Whirlpool hashes will update below"); | |||
| @@ -213,7 +227,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.4f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.4f))); | |||
| } | |||
| void resized() override | |||
| @@ -156,7 +156,7 @@ public: | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -158,8 +158,8 @@ struct FlexBoxDemo : public juce::Component, | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::lightgrey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::lightgrey)); | |||
| g.setColour (Colours::white); | |||
| g.fillRect (getFlexBoxBounds()); | |||
| } | |||
| @@ -34,12 +34,6 @@ class FontsDemo : public Component, | |||
| { | |||
| public: | |||
| FontsDemo() | |||
| : heightLabel (String(), "Height:"), | |||
| kerningLabel (String(), "Kerning:"), | |||
| scaleLabel (String(), "Scale:"), | |||
| styleLabel ("Style"), | |||
| boldToggle ("Bold"), | |||
| italicToggle ("Italic") | |||
| { | |||
| setOpaque (true); | |||
| @@ -71,6 +65,9 @@ public: | |||
| listBox.setRowHeight (20); | |||
| listBox.setModel (this); // Tell the listbox where to get its data model | |||
| listBox.setColour (ListBox::textColourId, Colours::black); | |||
| listBox.setColour (ListBox::backgroundColourId, Colours::white); | |||
| heightSlider.setRange (3.0, 150.0, 0.01); | |||
| scaleSlider.setRange (0.2, 3.0, 0.01); | |||
| @@ -106,17 +103,19 @@ public: | |||
| "non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); | |||
| demoTextBox.setCaretPosition (0); | |||
| demoTextBox.setColour (TextEditor::textColourId, Colours::black); | |||
| demoTextBox.setColour (TextEditor::backgroundColourId, Colours::white); | |||
| } | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| { | |||
| Rectangle<int> r (getLocalBounds().reduced (5)); | |||
| auto r = getLocalBounds().reduced (5); | |||
| // lay out the list box and vertical divider.. | |||
| Component* vcomps[] = { &listBox, verticalDividerBar, nullptr }; | |||
| @@ -134,7 +133,7 @@ public: | |||
| const int labelWidth = 60; | |||
| Rectangle<int> row (r.removeFromBottom (30)); | |||
| auto row = r.removeFromBottom (30); | |||
| row.removeFromLeft (labelWidth); | |||
| boldToggle.setBounds (row.removeFromLeft (row.getWidth() / 2)); | |||
| italicToggle.setBounds (row); | |||
| @@ -174,7 +173,7 @@ public: | |||
| if (rowIsSelected) | |||
| g.fillAll (Colours::lightblue); | |||
| Font font (fonts [rowNumber]); | |||
| Font font (fonts[rowNumber]); | |||
| AttributedString s; | |||
| s.setWordWrap (AttributedString::none); | |||
| @@ -196,9 +195,16 @@ private: | |||
| ListBox listBox; | |||
| TextEditor demoTextBox; | |||
| Label heightLabel, kerningLabel, scaleLabel, styleLabel; | |||
| Label heightLabel {{}, "Height:" }, | |||
| kerningLabel {{}, "Kerning:" }, | |||
| scaleLabel { "Scale:" }, | |||
| styleLabel { "Style" }; | |||
| ToggleButton boldToggle { "Bold" }, | |||
| italicToggle { "Italic" }; | |||
| Slider heightSlider, kerningSlider, scaleSlider; | |||
| ToggleButton boldToggle, italicToggle; | |||
| ComboBox styleBox; | |||
| StretchableLayoutManager verticalLayout; | |||
| @@ -45,17 +45,17 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| { | |||
| Rectangle<int> r (getLocalBounds().reduced (4)); | |||
| auto r = getLocalBounds().reduced (4); | |||
| int buttonHeight = 22; | |||
| Rectangle<int> columns (r.removeFromTop (buttonHeight * 4)); | |||
| Rectangle<int> col (columns.removeFromLeft (200)); | |||
| auto columns = r.removeFromTop (buttonHeight * 4); | |||
| auto col = columns.removeFromLeft (200); | |||
| animatePosition.setBounds (col.removeFromTop (buttonHeight)); | |||
| animateRotation.setBounds (col.removeFromTop (buttonHeight)); | |||
| @@ -630,7 +630,6 @@ public: | |||
| addAndMakeVisible (listBox); | |||
| listBox.setModel (this); | |||
| listBox.selectRow (0); | |||
| listBox.setColour (ListBox::backgroundColourId, Colour::greyLevel (0.9f)); | |||
| } | |||
| void resized() | |||
| @@ -645,14 +644,13 @@ public: | |||
| void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected) | |||
| { | |||
| Component* demo = demos [rowNumber]; | |||
| if (demo != nullptr) | |||
| if (auto* demo = demos[rowNumber]) | |||
| { | |||
| if (rowIsSelected) | |||
| g.fillAll (findColour (TextEditor::highlightColourId)); | |||
| g.fillAll (Colour::contrasting (findColour (ListBox::textColourId), | |||
| findColour (ListBox::backgroundColourId))); | |||
| g.setColour (Colours::black); | |||
| g.setColour (findColour (ListBox::textColourId)); | |||
| g.setFont (14.0f); | |||
| g.drawFittedText (demo->getName(), 8, 0, width - 10, height, Justification::centredLeft, 2); | |||
| } | |||
| @@ -693,7 +691,7 @@ public: | |||
| void resized() override | |||
| { | |||
| Rectangle<int> area (getLocalBounds()); | |||
| auto area = getLocalBounds(); | |||
| controllersComponent.setBounds (area.removeFromBottom (150)); | |||
| testList.setBounds (area.removeFromRight (150)); | |||
| demoHolder.setBounds (area); | |||
| @@ -41,7 +41,7 @@ public: | |||
| directoryThread.startThread (1); | |||
| fileTree.addListener (this); | |||
| fileTree.setColour (TreeView::backgroundColourId, Colours::lightgrey.withAlpha (0.6f)); | |||
| fileTree.setColour (TreeView::backgroundColourId, Colours::grey); | |||
| addAndMakeVisible (fileTree); | |||
| addAndMakeVisible (resizerBar); | |||
| @@ -68,12 +68,12 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (Colours::white); | |||
| } | |||
| void resized() override | |||
| { | |||
| Rectangle<int> r (getLocalBounds().reduced (4)); | |||
| auto r = getLocalBounds().reduced (4); | |||
| // make a list of two of our child components that we want to reposition | |||
| Component* comps[] = { &fileTree, &resizerBar, &imagePreview }; | |||
| @@ -125,7 +125,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| private: | |||
| @@ -34,11 +34,16 @@ public: | |||
| { | |||
| setOpaque (true); | |||
| addAndMakeVisible (keyMappingEditor); | |||
| LookAndFeel* lf = &LookAndFeel::getDefaultLookAndFeel(); | |||
| keyMappingEditor.setColours (lf->findColour (KeyMappingEditorComponent::backgroundColourId), | |||
| lf->findColour (KeyMappingEditorComponent::textColourId)); | |||
| } | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.93f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.93f))); | |||
| } | |||
| void resized() override | |||
| @@ -78,7 +78,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -32,7 +32,7 @@ | |||
| It's a good idea not to hard code your colours, use the findColour method along with appropriate | |||
| ColourIds so you can set these on a per-component basis. | |||
| */ | |||
| struct CustomLookAndFeel : public LookAndFeel_V3 | |||
| struct CustomLookAndFeel : public LookAndFeel_V4 | |||
| { | |||
| void drawRoundThumb (Graphics& g, const float x, const float y, | |||
| const float diameter, const Colour& colour, float outlineThickness) | |||
| @@ -116,7 +116,7 @@ struct CustomLookAndFeel : public LookAndFeel_V3 | |||
| if (ticked) | |||
| { | |||
| const Path tick (LookAndFeel_V2::getTickShape (6.0f)); | |||
| const Path tick (LookAndFeel_V4::getTickShape (6.0f)); | |||
| g.setColour (isEnabled ? findColour (TextButton::buttonOnColourId) : Colours::grey); | |||
| const float scale = 9.0f; | |||
| @@ -315,7 +315,7 @@ struct SquareLookAndFeel : public CustomLookAndFeel | |||
| if (ticked) | |||
| { | |||
| const Path tick (LookAndFeel_V3::getTickShape (6.0f)); | |||
| const Path tick (LookAndFeel_V4::getTickShape (6.0f)); | |||
| g.setColour (isEnabled ? findColour (TextButton::buttonColourId) : Colours::grey); | |||
| const AffineTransform trans (RectanglePlacement (RectanglePlacement::centred) | |||
| @@ -509,6 +509,10 @@ public: | |||
| addLookAndFeel (new LookAndFeel_V1(), "LookAndFeel_V1"); | |||
| addLookAndFeel (new LookAndFeel_V2(), "LookAndFeel_V2"); | |||
| addLookAndFeel (new LookAndFeel_V3(), "LookAndFeel_V3"); | |||
| addLookAndFeel (new LookAndFeel_V4(), "LookAndFeel_V4 (Dark)"); | |||
| addLookAndFeel (new LookAndFeel_V4 (LookAndFeel_V4::getMidnightColourScheme()), "LookAndFeel_V4 (Midnight)"); | |||
| addLookAndFeel (new LookAndFeel_V4 (LookAndFeel_V4::getGreyColourScheme()), "LookAndFeel_V4 (Grey)"); | |||
| addLookAndFeel (new LookAndFeel_V4 (LookAndFeel_V4::getLightColourScheme()), "LookAndFeel_V4 (Light)"); | |||
| CustomLookAndFeel* claf = new CustomLookAndFeel(); | |||
| addLookAndFeel (claf, "Custom Look And Feel"); | |||
| @@ -528,7 +532,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.4f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.4f))); | |||
| } | |||
| void resized() override | |||
| @@ -189,7 +189,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -42,7 +42,8 @@ public: | |||
| if (isPositiveAndBelow (row, midiMessageList.size())) | |||
| { | |||
| g.setColour (Colours::black); | |||
| g.setColour (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::black)); | |||
| const MidiMessage& message = midiMessageList.getReference (row); | |||
| double time = message.getTimeStamp(); | |||
| @@ -120,8 +121,6 @@ public: | |||
| addAndMakeVisible (messageListBox); | |||
| messageListBox.setModel (&midiLogListBoxModel); | |||
| messageListBox.setColour (ListBox::backgroundColourId, Colour (0x32ffffff)); | |||
| messageListBox.setColour (ListBox::outlineColourId, Colours::black); | |||
| } | |||
| ~MidiDemo() | |||
| @@ -133,7 +132,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -36,9 +36,11 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.4f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.4f))); | |||
| g.setColour (Colours::lightgrey); | |||
| g.setColour (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::lightgrey)); | |||
| g.setFont (14.0f); | |||
| g.drawFittedText ("Drag here with as many fingers as you have!", | |||
| getLocalBounds().reduced (30), Justification::centred, 4); | |||
| @@ -244,7 +244,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| private: | |||
| @@ -51,7 +51,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -344,7 +344,6 @@ struct OpenGLDemoClasses | |||
| { | |||
| addAndMakeVisible (statusLabel); | |||
| statusLabel.setJustificationType (Justification::topLeft); | |||
| statusLabel.setColour (Label::textColourId, Colours::black); | |||
| statusLabel.setFont (Font (14.0f)); | |||
| addAndMakeVisible (sizeSlider); | |||
| @@ -367,7 +366,9 @@ struct OpenGLDemoClasses | |||
| addAndMakeVisible (showBackgroundToggle); | |||
| showBackgroundToggle.addListener (this); | |||
| Colour editorBackground (Colours::white.withAlpha (0.6f)); | |||
| Colour editorBackground = dynamic_cast<LookAndFeel_V4*> (&LookAndFeel::getDefaultLookAndFeel()) | |||
| ? getLookAndFeel().findColour (ResizableWindow::backgroundColourId) | |||
| : Colours::white; | |||
| addAndMakeVisible (tabbedComp); | |||
| tabbedComp.setTabBarDepth (25); | |||
| @@ -645,7 +646,9 @@ struct OpenGLDemoClasses | |||
| jassert (OpenGLHelpers::isContextActive()); | |||
| const float desktopScale = (float) openGLContext.getRenderingScale(); | |||
| OpenGLHelpers::clear (Colours::lightblue); | |||
| OpenGLHelpers::clear (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::lightblue)); | |||
| if (textureToUse != nullptr) | |||
| if (! textureToUse->applyTo (texture)) | |||
| @@ -43,7 +43,6 @@ public: | |||
| addAndMakeVisible (statusLabel); | |||
| statusLabel.setJustificationType (Justification::topLeft); | |||
| statusLabel.setColour (Label::textColourId, Colours::black); | |||
| statusLabel.setFont (Font (14.0f)); | |||
| Array<ShaderPreset> presets (getPresets()); | |||
| @@ -59,8 +58,6 @@ public: | |||
| addAndMakeVisible (presetBox); | |||
| presetBox.addListener (this); | |||
| Colour editorBackground (Colours::white.withAlpha (0.6f)); | |||
| fragmentEditorComp.setColour (CodeEditorComponent::backgroundColourId, editorBackground); | |||
| fragmentEditorComp.setOpaque (false); | |||
| fragmentDocument.addListener (this); | |||
| addAndMakeVisible (fragmentEditorComp); | |||
| @@ -158,7 +158,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.8f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.8f))); | |||
| } | |||
| void resized() override | |||
| @@ -212,7 +213,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.8f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.8f))); | |||
| } | |||
| void resized() override | |||
| @@ -223,7 +225,7 @@ public: | |||
| void timerCallback() override | |||
| { | |||
| stopTimer(); | |||
| concertinaPanel.expandPanelFully (concertinaPanel.getPanel(0), true); | |||
| concertinaPanel.expandPanelFully (concertinaPanel.getPanel (0), true); | |||
| } | |||
| private: | |||
| @@ -188,7 +188,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour::greyLevel (0.93f)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colour::greyLevel (0.93f))); | |||
| } | |||
| void resized() override | |||
| @@ -192,7 +192,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::darkgrey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::darkgrey)); | |||
| } | |||
| void paintOverChildren (Graphics& g) override | |||
| @@ -205,7 +206,8 @@ public: | |||
| s.append ("Click the \"Set Random Colour\" button to change the colour of one of the circles."); | |||
| s.append (newLine); | |||
| s.setFont (Font (16.0f)); | |||
| s.setColour (Colours::lightgrey); | |||
| s.setColour (getUIColourIfAvailable(LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::lightgrey)); | |||
| s.draw (g, explanationArea.reduced (10).toFloat()); | |||
| } | |||
| @@ -126,7 +126,8 @@ struct UnitTestClasses | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::grey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::grey)); | |||
| } | |||
| void resized() override | |||
| @@ -48,7 +48,8 @@ public: | |||
| void paintItem (Graphics& g, int width, int height) override | |||
| { | |||
| g.setColour (Colours::black); | |||
| g.setColour (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::black)); | |||
| g.setFont (15.0f); | |||
| g.drawText (tree["name"].toString(), | |||
| @@ -168,7 +169,6 @@ public: | |||
| tree.setDefaultOpenness (true); | |||
| tree.setMultiSelectEnabled (true); | |||
| tree.setRootItem (rootItem = new ValueTreeItem (createRootValueTree(), undoManager)); | |||
| tree.setColour (TreeView::backgroundColourId, Colours::white); | |||
| addAndMakeVisible (undoButton); | |||
| addAndMakeVisible (redoButton); | |||
| @@ -185,7 +185,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -137,7 +137,7 @@ public: | |||
| directoryThread.startThread (1); | |||
| fileTree.addListener (this); | |||
| fileTree.setColour (TreeView::backgroundColourId, Colours::lightgrey); | |||
| fileTree.setColour (FileTreeComponent::backgroundColourId, Colours::lightgrey.withAlpha (0.6f)); | |||
| addAndMakeVisible (fileTree); | |||
| addAndMakeVisible (resizerBar); | |||
| @@ -176,7 +176,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -100,7 +100,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::grey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::grey)); | |||
| } | |||
| void resized() override | |||
| @@ -42,6 +42,7 @@ static void showBubbleMessage (Component* targetComponent, const String& textToS | |||
| AttributedString text (textToShow); | |||
| text.setJustification (Justification::centred); | |||
| text.setColour (targetComponent->findColour (TextButton::textColourOffId)); | |||
| bmc->showAt (targetComponent, text, 2000, true, false); | |||
| } | |||
| @@ -278,6 +279,8 @@ struct ButtonsPage : public Component, | |||
| tb->setClickingTogglesState (true); | |||
| tb->setRadioGroupId (34567); | |||
| tb->setColour (TextButton::textColourOffId, Colours::black); | |||
| tb->setColour (TextButton::textColourOnId, Colours::black); | |||
| tb->setColour (TextButton::buttonColourId, Colours::white); | |||
| tb->setColour (TextButton::buttonOnColourId, Colours::blueviolet.brighter()); | |||
| @@ -745,10 +748,12 @@ public: | |||
| // This is overloaded from TableListBoxModel, and should fill in the background of the whole row | |||
| void paintRowBackground (Graphics& g, int rowNumber, int /*width*/, int /*height*/, bool rowIsSelected) override | |||
| { | |||
| const Colour alternateColour (getLookAndFeel().findColour (ListBox::backgroundColourId) | |||
| .interpolatedWith (getLookAndFeel().findColour (ListBox::textColourId), 0.03f)); | |||
| if (rowIsSelected) | |||
| g.fillAll (Colours::lightblue); | |||
| else if (rowNumber % 2) | |||
| g.fillAll (Colour (0xffeeeeee)); | |||
| g.fillAll (alternateColour); | |||
| } | |||
| // This is overloaded from TableListBoxModel, and must paint any cells that aren't using custom | |||
| @@ -756,7 +761,7 @@ public: | |||
| void paintCell (Graphics& g, int rowNumber, int columnId, | |||
| int width, int height, bool /*rowIsSelected*/) override | |||
| { | |||
| g.setColour (Colours::black); | |||
| g.setColour (getLookAndFeel().findColour (ListBox::textColourId)); | |||
| g.setFont (font); | |||
| if (const XmlElement* rowElement = dataList->getChildElement (rowNumber)) | |||
| @@ -766,7 +771,7 @@ public: | |||
| g.drawText (text, 2, 0, width - 4, height, Justification::centredLeft, true); | |||
| } | |||
| g.setColour (Colours::black.withAlpha (0.2f)); | |||
| g.setColour (getLookAndFeel().findColour (ListBox::backgroundColourId)); | |||
| g.fillRect (width - 1, 0, 1, height); | |||
| } | |||
| @@ -888,7 +893,6 @@ private: | |||
| { | |||
| // double click to edit the label text; single click handled below | |||
| setEditable (false, true, false); | |||
| setColour (textColourId, Colours::black); | |||
| } | |||
| void mouseDown (const MouseEvent& event) override | |||
| @@ -912,12 +916,21 @@ private: | |||
| setText (owner.getText(columnId, row), dontSendNotification); | |||
| } | |||
| void paint (Graphics& g) override | |||
| { | |||
| auto& lf = getLookAndFeel(); | |||
| if (! dynamic_cast<LookAndFeel_V4*> (&lf)) | |||
| lf.setColour (textColourId, Colours::black); | |||
| Label::paint (g); | |||
| } | |||
| private: | |||
| TableDemoComponent& owner; | |||
| int row, columnId; | |||
| Colour textColour; | |||
| }; | |||
| //============================================================================== | |||
| // This is a custom component containing a combo box, which we're going to put inside | |||
| // our table's "rating" column. | |||
| @@ -1063,7 +1076,7 @@ private: | |||
| if (rowIsSelected) | |||
| g.fillAll (Colours::lightblue); | |||
| g.setColour (Colours::black); | |||
| g.setColour (LookAndFeel::getDefaultLookAndFeel().findColour (Label::textColourId)); | |||
| g.setFont (height * 0.7f); | |||
| g.drawText ("Draggable Thing #" + String (rowNumber + 1), | |||
| @@ -1110,7 +1123,7 @@ private: | |||
| g.drawRect (getLocalBounds(), 3); | |||
| } | |||
| g.setColour (Colours::black); | |||
| g.setColour (getLookAndFeel().findColour (Label::textColourId)); | |||
| g.setFont (14.0f); | |||
| g.drawFittedText (message, getLocalBounds().reduced (10, 0), Justification::centred, 4); | |||
| } | |||
| @@ -1235,6 +1248,7 @@ private: | |||
| //============================================================================== | |||
| class MenusDemo : public Component, | |||
| public MenuBarModel, | |||
| public ChangeBroadcaster, | |||
| private Button::Listener | |||
| { | |||
| public: | |||
| @@ -1296,6 +1310,15 @@ public: | |||
| menu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV1); | |||
| menu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV2); | |||
| menu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV3); | |||
| PopupMenu v4SubMenu; | |||
| v4SubMenu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV4Dark); | |||
| v4SubMenu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV4Midnight); | |||
| v4SubMenu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV4Grey); | |||
| v4SubMenu.addCommandItem (commandManager, MainAppWindow::useLookAndFeelV4Light); | |||
| menu.addSubMenu ("Use LookAndFeel_V4", v4SubMenu); | |||
| menu.addSeparator(); | |||
| menu.addCommandItem (commandManager, MainAppWindow::useNativeTitleBar); | |||
| @@ -1371,6 +1394,10 @@ public: | |||
| tabs->setOrientation (o); | |||
| } | |||
| } | |||
| else if (menuItemID >= 12298 && menuItemID <= 12305) | |||
| { | |||
| sendChangeMessage(); | |||
| } | |||
| } | |||
| private: | |||
| @@ -1466,26 +1493,35 @@ private: | |||
| }; | |||
| //============================================================================== | |||
| class DemoTabbedComponent : public TabbedComponent | |||
| class DemoTabbedComponent : public TabbedComponent, | |||
| private ChangeListener | |||
| { | |||
| public: | |||
| DemoTabbedComponent() | |||
| : TabbedComponent (TabbedButtonBar::TabsAtTop) | |||
| { | |||
| addTab ("Menus", getRandomTabBackgroundColour(), new MenusDemo(), true); | |||
| addTab ("Buttons", getRandomTabBackgroundColour(), new ButtonsPage(), true); | |||
| addTab ("Sliders", getRandomTabBackgroundColour(), new SlidersPage(), true); | |||
| addTab ("Toolbars", getRandomTabBackgroundColour(), new ToolbarDemoComp(), true); | |||
| addTab ("Misc", getRandomTabBackgroundColour(), new MiscPage(), true); | |||
| addTab ("Tables", getRandomTabBackgroundColour(), new TableDemoComponent(), true); | |||
| addTab ("Drag & Drop", getRandomTabBackgroundColour(), new DragAndDropDemo(), true); | |||
| // Register this class as a ChangeListener to the menus demo so we can update the tab colours when the LookAndFeel is changed | |||
| menusDemo = new MenusDemo(); | |||
| menusDemo->addChangeListener (this); | |||
| const Colour c; | |||
| addTab ("Menus", c, menusDemo, true); | |||
| addTab ("Buttons", c, new ButtonsPage(), true); | |||
| addTab ("Sliders", c, new SlidersPage(), true); | |||
| addTab ("Toolbars", c, new ToolbarDemoComp(), true); | |||
| addTab ("Misc", c, new MiscPage(), true); | |||
| addTab ("Tables", c, new TableDemoComponent(), true); | |||
| addTab ("Drag & Drop", c, new DragAndDropDemo(), true); | |||
| updateTabColours(); | |||
| getTabbedButtonBar().getTabButton (5)->setExtraComponent (new CustomTabButton(), TabBarButton::afterText); | |||
| } | |||
| static Colour getRandomTabBackgroundColour() | |||
| void changeListenerCallback (ChangeBroadcaster* source) override | |||
| { | |||
| return Colour (Random::getSystemRandom().nextFloat(), 0.1f, 0.97f, 1.0f); | |||
| if (dynamic_cast<MenusDemo*> (source) != nullptr) | |||
| updateTabColours(); | |||
| } | |||
| // This is a small star button that is put inside one of the tabs. You can | |||
| @@ -1519,12 +1555,26 @@ public: | |||
| private: | |||
| ScopedPointer<BubbleMessageComponent> bubbleMessage; | |||
| }; | |||
| private: | |||
| ScopedPointer<MenusDemo> menusDemo; //need to have keep a pointer around to register this class as a ChangeListener | |||
| void updateTabColours() | |||
| { | |||
| bool randomiseColours = ! dynamic_cast<LookAndFeel_V4*> (&LookAndFeel::getDefaultLookAndFeel()); | |||
| for (int i = 0; i < getNumTabs(); ++i) | |||
| { | |||
| if (randomiseColours) | |||
| setTabBackgroundColour (i, Colour (Random::getSystemRandom().nextFloat(), 0.1f, 0.97f, 1.0f)); | |||
| else | |||
| setTabBackgroundColour (i, getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| } | |||
| } | |||
| }; | |||
| //============================================================================== | |||
| class WidgetsDemo : public Component | |||
| struct WidgetsDemo : public Component | |||
| { | |||
| public: | |||
| WidgetsDemo() | |||
| { | |||
| setOpaque (true); | |||
| @@ -1541,7 +1591,6 @@ public: | |||
| tabs.setBounds (getLocalBounds().reduced (4)); | |||
| } | |||
| private: | |||
| DemoTabbedComponent tabs; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WidgetsDemo) | |||
| @@ -229,7 +229,8 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::grey); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground, | |||
| Colours::grey)); | |||
| } | |||
| void resized() override | |||
| @@ -254,7 +254,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| fillStandardDemoBackground (g); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| @@ -30,7 +30,6 @@ class IntroScreen : public Component | |||
| { | |||
| public: | |||
| IntroScreen() | |||
| : linkButton ("www.juce.com", URL ("http://www.juce.com")) | |||
| { | |||
| setOpaque (true); | |||
| @@ -38,7 +37,7 @@ public: | |||
| addAndMakeVisible (linkButton); | |||
| addAndMakeVisible (logo); | |||
| versionLabel.setColour (Label::textColourId, Colours::white); | |||
| // versionLabel.setColour (Label::textColourId, Colours::white); | |||
| versionLabel.setText (String ("{version} built on {date}") | |||
| .replace ("{version}", SystemStats::getJUCEVersion()) | |||
| .replace ("{date}", String (__DATE__).replace (" ", " ")), | |||
| @@ -49,12 +48,12 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colour (0xff4d4d4d)); | |||
| g.fillAll (getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::windowBackground)); | |||
| } | |||
| void resized() override | |||
| { | |||
| Rectangle<int> area (getLocalBounds().reduced (10)); | |||
| auto area = getLocalBounds().reduced (10); | |||
| logo.setBounds (area); | |||
| area = area.removeFromBottom (24); | |||
| linkButton.setBounds (area.removeFromRight (getWidth() / 4)); | |||
| @@ -63,13 +62,13 @@ public: | |||
| private: | |||
| Label versionLabel; | |||
| HyperlinkButton linkButton; | |||
| HyperlinkButton linkButton { "www.juce.com", URL ("http://www.juce.com") }; | |||
| //============================================================================== | |||
| struct LogoDrawComponent : public Component, | |||
| private Timer | |||
| { | |||
| LogoDrawComponent() : logoPath (MainAppWindow::getJUCELogoPath()), elapsed (0.0f) | |||
| LogoDrawComponent() | |||
| { | |||
| startTimerHz (30); // repaint at 30 fps | |||
| } | |||
| @@ -103,20 +102,18 @@ private: | |||
| getLocalBounds().reduced (20, getHeight() / 4).toFloat())); | |||
| } | |||
| private: | |||
| void timerCallback() override | |||
| { | |||
| repaint(); | |||
| elapsed += 0.02f; | |||
| } | |||
| Path logoPath; | |||
| float elapsed; | |||
| Path logoPath { MainAppWindow::getJUCELogoPath() }; | |||
| float elapsed = 0; | |||
| }; | |||
| LogoDrawComponent logo; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (IntroScreen) | |||
| }; | |||
| @@ -36,6 +36,7 @@ public: | |||
| //============================================================================== | |||
| void initialise (const String& commandLine) override | |||
| { | |||
| // (This function call is for one of the demos, which involves launching a child process) | |||
| if (invokeChildProcessDemo (commandLine)) | |||
| return; | |||
| @@ -55,10 +55,9 @@ Array<JuceDemoTypeBase*>& JuceDemoTypeBase::getDemoTypeList() | |||
| #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC | |||
| // Just add a simple icon to the Window system tray area or Mac menu bar.. | |||
| class DemoTaskbarComponent : public SystemTrayIconComponent, | |||
| private Timer | |||
| struct DemoTaskbarComponent : public SystemTrayIconComponent, | |||
| private Timer | |||
| { | |||
| public: | |||
| DemoTaskbarComponent() | |||
| { | |||
| setIconImage (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize)); | |||
| @@ -83,7 +82,6 @@ public: | |||
| JUCEApplication::getInstance()->systemRequestedQuit(); | |||
| } | |||
| private: | |||
| void timerCallback() override | |||
| { | |||
| stopTimer(); | |||
| @@ -113,13 +111,17 @@ public: | |||
| lookAndFeelV3.setColour (Label::textColourId, Colours::white); | |||
| lookAndFeelV3.setColour (Label::textColourId, Colours::white); | |||
| lookAndFeelV3.setColour (ToggleButton::textColourId, Colours::white); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV4); | |||
| demoList.setModel (this); | |||
| demoList.setColour (ListBox::backgroundColourId, Colour::greyLevel (0.2f)); | |||
| updateDemoListColours(); | |||
| demoList.selectRow (0); | |||
| addAndMakeVisible (demoList); | |||
| if (Desktop::getInstance().getMainMouseSource().isTouch()) | |||
| demoList.getViewport()->setScrollOnDragEnabled (true); | |||
| addAndMakeVisible (demoList); | |||
| } | |||
| void clearCurrentDemo() | |||
| @@ -129,7 +131,7 @@ public: | |||
| void resized() override | |||
| { | |||
| Rectangle<int> r (getLocalBounds()); | |||
| auto r = getLocalBounds(); | |||
| if (r.getWidth() > 600) | |||
| { | |||
| @@ -156,9 +158,9 @@ public: | |||
| if (rowIsSelected) | |||
| g.fillAll (Colours::deepskyblue); | |||
| if (JuceDemoTypeBase* type = JuceDemoTypeBase::getDemoTypeList() [rowNumber]) | |||
| if (auto* type = JuceDemoTypeBase::getDemoTypeList() [rowNumber]) | |||
| { | |||
| String name (type->name.trimCharactersAtStart ("0123456789").trimStart()); | |||
| auto name = type->name.trimCharactersAtStart ("0123456789").trimStart(); | |||
| AttributedString a; | |||
| a.setJustification (Justification::centredLeft); | |||
| @@ -176,10 +178,13 @@ public: | |||
| category << " "; | |||
| } | |||
| auto categoryColour = demoList.findColour (ListBox::outlineColourId); | |||
| auto nameColour = demoList.findColour (ListBox::textColourId); | |||
| if (category.isNotEmpty()) | |||
| a.append (category, Font (10.0f), Colour::greyLevel (0.5f)); | |||
| a.append (category, Font (10.0f), categoryColour); | |||
| a.append (name, Font (13.0f), Colours::white.withAlpha (0.9f)); | |||
| a.append (name, Font (13.0f), nameColour); | |||
| a.draw (g, Rectangle<int> (width + 10, height).reduced (6, 0).toFloat()); | |||
| } | |||
| @@ -187,7 +192,7 @@ public: | |||
| void selectedRowsChanged (int lastRowSelected) override | |||
| { | |||
| if (JuceDemoTypeBase* selectedDemoType = JuceDemoTypeBase::getDemoTypeList() [lastRowSelected]) | |||
| if (auto* selectedDemoType = JuceDemoTypeBase::getDemoTypeList() [lastRowSelected]) | |||
| { | |||
| currentDemo = nullptr; | |||
| addAndMakeVisible (currentDemo = selectedDemoType->createComponent()); | |||
| @@ -206,7 +211,7 @@ public: | |||
| if (currentDemo == nullptr) | |||
| return -1; | |||
| Array<JuceDemoTypeBase*>& demos (JuceDemoTypeBase::getDemoTypeList()); | |||
| auto& demos = JuceDemoTypeBase::getDemoTypeList(); | |||
| for (int i = demos.size(); --i >= 0;) | |||
| if (demos.getUnchecked (i)->name == currentDemo->getName()) | |||
| @@ -217,10 +222,8 @@ public: | |||
| void moveDemoPages (int numPagesToMove) | |||
| { | |||
| const int newIndex = negativeAwareModulo (getCurrentPageIndex() + numPagesToMove, | |||
| JuceDemoTypeBase::getDemoTypeList().size()); | |||
| demoList.selectRow (newIndex); | |||
| // we have to go through our demo list here or it won't be updated to reflect the current demo | |||
| demoList.selectRow (negativeAwareModulo (getCurrentPageIndex() + numPagesToMove, | |||
| JuceDemoTypeBase::getDemoTypeList().size())); | |||
| } | |||
| bool isShowingOpenGLDemo() const | |||
| @@ -242,6 +245,7 @@ private: | |||
| LookAndFeel_V1 lookAndFeelV1; | |||
| LookAndFeel_V2 lookAndFeelV2; | |||
| LookAndFeel_V3 lookAndFeelV3; | |||
| LookAndFeel_V4 lookAndFeelV4; | |||
| //============================================================================== | |||
| // The following methods implement the ApplicationCommandTarget interface, allowing | |||
| @@ -272,6 +276,10 @@ private: | |||
| MainAppWindow::useLookAndFeelV1, | |||
| MainAppWindow::useLookAndFeelV2, | |||
| MainAppWindow::useLookAndFeelV3, | |||
| MainAppWindow::useLookAndFeelV4Dark, | |||
| MainAppWindow::useLookAndFeelV4Midnight, | |||
| MainAppWindow::useLookAndFeelV4Grey, | |||
| MainAppWindow::useLookAndFeelV4Light, | |||
| MainAppWindow::toggleRepaintDebugging, | |||
| #if ! JUCE_LINUX | |||
| MainAppWindow::goToKioskMode, | |||
| @@ -285,7 +293,7 @@ private: | |||
| MainAppWindow::renderingEngineTwo, | |||
| MainAppWindow::renderingEngineThree }; | |||
| StringArray renderingEngines (MainAppWindow::getMainAppWindow()->getRenderingEngines()); | |||
| auto renderingEngines = MainAppWindow::getMainAppWindow()->getRenderingEngines(); | |||
| commands.addArray (engineIDs, renderingEngines.size()); | |||
| } | |||
| @@ -355,8 +363,8 @@ private: | |||
| case MainAppWindow::renderingEngineTwo: | |||
| case MainAppWindow::renderingEngineThree: | |||
| { | |||
| MainAppWindow& mainWindow = *MainAppWindow::getMainAppWindow(); | |||
| const StringArray engines (mainWindow.getRenderingEngines()); | |||
| auto& mainWindow = *MainAppWindow::getMainAppWindow(); | |||
| auto engines = mainWindow.getRenderingEngines(); | |||
| const int index = commandID - MainAppWindow::renderingEngineOne; | |||
| result.setInfo ("Use " + engines[index], "Uses the " + engines[index] + " engine to render the UI", generalCategory, 0); | |||
| @@ -384,6 +392,27 @@ private: | |||
| result.setTicked (isLookAndFeelSelected<LookAndFeel_V3>()); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Dark: | |||
| result.setInfo ("Use LookAndFeel_V4 Dark", String(), generalCategory, 0); | |||
| result.addDefaultKeypress ('k', ModifierKeys::commandModifier); | |||
| result.setTicked (isColourSchemeActive (LookAndFeel_V4::getDarkColourScheme())); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Midnight: | |||
| result.setInfo ("Use LookAndFeel_V4 Midnight", String(), generalCategory, 0); | |||
| result.setTicked (isColourSchemeActive (LookAndFeel_V4::getMidnightColourScheme())); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Grey: | |||
| result.setInfo ("Use LookAndFeel_V4 Grey", String(), generalCategory, 0); | |||
| result.setTicked (isColourSchemeActive (LookAndFeel_V4::getGreyColourScheme())); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Light: | |||
| result.setInfo ("Use LookAndFeel_V4 Light", String(), generalCategory, 0); | |||
| result.setTicked (isColourSchemeActive (LookAndFeel_V4::getLightColourScheme())); | |||
| break; | |||
| case MainAppWindow::toggleRepaintDebugging: | |||
| result.setInfo ("Toggle repaint display", String(), generalCategory, 0); | |||
| result.addDefaultKeypress ('r', ModifierKeys()); | |||
| @@ -396,8 +425,8 @@ private: | |||
| result.addDefaultKeypress ('n', ModifierKeys::commandModifier); | |||
| bool nativeTitlebar = false; | |||
| if (MainAppWindow* map = MainAppWindow::getMainAppWindow()) | |||
| nativeTitlebar = map->isUsingNativeTitleBar(); | |||
| if (auto* mainWindow = MainAppWindow::getMainAppWindow()) | |||
| nativeTitlebar = mainWindow->isUsingNativeTitleBar(); | |||
| result.setTicked (nativeTitlebar); | |||
| break; | |||
| @@ -418,63 +447,90 @@ private: | |||
| bool perform (const InvocationInfo& info) override | |||
| { | |||
| MainAppWindow* mainWindow = MainAppWindow::getMainAppWindow(); | |||
| if (mainWindow == nullptr) | |||
| return true; | |||
| switch (info.commandID) | |||
| if (auto* mainWindow = MainAppWindow::getMainAppWindow()) | |||
| { | |||
| case MainAppWindow::showPreviousDemo: moveDemoPages (-1); break; | |||
| case MainAppWindow::showNextDemo: moveDemoPages ( 1); break; | |||
| case MainAppWindow::welcome: | |||
| case MainAppWindow::componentsAnimation: | |||
| case MainAppWindow::componentsDialogBoxes: | |||
| case MainAppWindow::componentsKeyMappings: | |||
| case MainAppWindow::componentsMDI: | |||
| case MainAppWindow::componentsPropertyEditors: | |||
| case MainAppWindow::componentsTransforms: | |||
| case MainAppWindow::componentsWebBrowsers: | |||
| case MainAppWindow::componentsWidgets: | |||
| demoList.selectRow (info.commandID - MainAppWindow::welcome); | |||
| break; | |||
| switch (info.commandID) | |||
| { | |||
| case MainAppWindow::showPreviousDemo: moveDemoPages (-1); break; | |||
| case MainAppWindow::showNextDemo: moveDemoPages ( 1); break; | |||
| case MainAppWindow::welcome: | |||
| case MainAppWindow::componentsAnimation: | |||
| case MainAppWindow::componentsDialogBoxes: | |||
| case MainAppWindow::componentsKeyMappings: | |||
| case MainAppWindow::componentsMDI: | |||
| case MainAppWindow::componentsPropertyEditors: | |||
| case MainAppWindow::componentsTransforms: | |||
| case MainAppWindow::componentsWebBrowsers: | |||
| case MainAppWindow::componentsWidgets: | |||
| demoList.selectRow (info.commandID - MainAppWindow::welcome); | |||
| break; | |||
| case MainAppWindow::renderingEngineOne: | |||
| case MainAppWindow::renderingEngineTwo: | |||
| case MainAppWindow::renderingEngineThree: | |||
| mainWindow->setRenderingEngine (info.commandID - MainAppWindow::renderingEngineOne); | |||
| break; | |||
| case MainAppWindow::renderingEngineOne: | |||
| case MainAppWindow::renderingEngineTwo: | |||
| case MainAppWindow::renderingEngineThree: | |||
| mainWindow->setRenderingEngine (info.commandID - MainAppWindow::renderingEngineOne); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV1: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1); break; | |||
| case MainAppWindow::useLookAndFeelV2: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV2); break; | |||
| case MainAppWindow::useLookAndFeelV3: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); break; | |||
| case MainAppWindow::useLookAndFeelV1: | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV2: | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV2); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV3: | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Dark: | |||
| lookAndFeelV4.setColourScheme (LookAndFeel_V4::getDarkColourScheme()); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV4); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Midnight: | |||
| lookAndFeelV4.setColourScheme (LookAndFeel_V4::getMidnightColourScheme()); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV4); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Grey: | |||
| lookAndFeelV4.setColourScheme (LookAndFeel_V4::getGreyColourScheme()); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV4); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::useLookAndFeelV4Light: | |||
| lookAndFeelV4.setColourScheme (LookAndFeel_V4::getLightColourScheme()); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV4); | |||
| updateDemoListColours(); | |||
| break; | |||
| case MainAppWindow::toggleRepaintDebugging: | |||
| juceDemoRepaintDebuggingActive = ! juceDemoRepaintDebuggingActive; | |||
| mainWindow->repaint(); | |||
| break; | |||
| case MainAppWindow::toggleRepaintDebugging: | |||
| juceDemoRepaintDebuggingActive = ! juceDemoRepaintDebuggingActive; | |||
| mainWindow->repaint(); | |||
| break; | |||
| case MainAppWindow::useNativeTitleBar: | |||
| mainWindow->setUsingNativeTitleBar (! mainWindow->isUsingNativeTitleBar()); | |||
| break; | |||
| case MainAppWindow::useNativeTitleBar: | |||
| mainWindow->setUsingNativeTitleBar (! mainWindow->isUsingNativeTitleBar()); | |||
| break; | |||
| #if ! JUCE_LINUX | |||
| case MainAppWindow::goToKioskMode: | |||
| { | |||
| Desktop& desktop = Desktop::getInstance(); | |||
| #if ! JUCE_LINUX | |||
| case MainAppWindow::goToKioskMode: | |||
| { | |||
| auto& desktop = Desktop::getInstance(); | |||
| if (desktop.getKioskModeComponent() == nullptr) | |||
| desktop.setKioskModeComponent (getTopLevelComponent()); | |||
| else | |||
| desktop.setKioskModeComponent (nullptr); | |||
| if (desktop.getKioskModeComponent() == nullptr) | |||
| desktop.setKioskModeComponent (getTopLevelComponent()); | |||
| else | |||
| desktop.setKioskModeComponent (nullptr); | |||
| break; | |||
| } | |||
| #endif | |||
| break; | |||
| } | |||
| #endif | |||
| default: | |||
| return false; | |||
| default: | |||
| return false; | |||
| } | |||
| } | |||
| return true; | |||
| @@ -486,6 +542,28 @@ private: | |||
| LookAndFeel& lf = getLookAndFeel(); | |||
| return typeid (LookAndFeelType) == typeid (lf); | |||
| } | |||
| bool isColourSchemeActive (LookAndFeel_V4::ColourScheme scheme) | |||
| { | |||
| if (auto* v4 = dynamic_cast<LookAndFeel_V4*> (&LookAndFeel::getDefaultLookAndFeel())) | |||
| if (v4->getCurrentColourScheme() == scheme) | |||
| return true; | |||
| return false; | |||
| } | |||
| void updateDemoListColours() | |||
| { | |||
| demoList.setColour (ListBox::backgroundColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::widgetBackground, Colour::greyLevel (0.2f))); | |||
| demoList.setColour (ListBox::textColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colours::white.withAlpha (0.9f))); | |||
| demoList.setColour (ListBox::outlineColourId, | |||
| getUIColourIfAvailable (LookAndFeel_V4::ColourScheme::UIColour::defaultText, | |||
| Colour::greyLevel (0.5f)).interpolatedWith (Colours::red, 0.4f)); | |||
| } | |||
| }; | |||
| //============================================================================== | |||
| @@ -494,7 +572,7 @@ static ScopedPointer<AudioDeviceManager> sharedAudioDeviceManager; | |||
| MainAppWindow::MainAppWindow() | |||
| : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -574,7 +652,7 @@ void MainAppWindow::runtimePermissionsCallback (bool wasGranted) | |||
| MainAppWindow* MainAppWindow::getMainAppWindow() | |||
| { | |||
| for (int i = TopLevelWindow::getNumTopLevelWindows(); --i >= 0;) | |||
| if (MainAppWindow* maw = dynamic_cast<MainAppWindow*> (TopLevelWindow::getTopLevelWindow (i))) | |||
| if (auto* maw = dynamic_cast<MainAppWindow*> (TopLevelWindow::getTopLevelWindow (i))) | |||
| return maw; | |||
| return nullptr; | |||
| @@ -584,7 +662,8 @@ void MainAppWindow::handleAsyncUpdate() | |||
| { | |||
| // This registers all of our commands with the command manager but has to be done after the window has | |||
| // been created so we can find the number of rendering engines available | |||
| ApplicationCommandManager& commandManager = MainAppWindow::getApplicationCommandManager(); | |||
| auto& commandManager = MainAppWindow::getApplicationCommandManager(); | |||
| commandManager.registerAllCommandsForTarget (contentComponent); | |||
| commandManager.registerAllCommandsForTarget (JUCEApplication::getInstance()); | |||
| } | |||
| @@ -597,7 +676,7 @@ void MainAppWindow::showMessageBubble (const String& text) | |||
| AttributedString attString; | |||
| attString.append (text, Font (15.0f)); | |||
| currentBubbleMessage->showAt (Rectangle<int> (getLocalBounds().getCentreX(), 10, 1, 1), | |||
| currentBubbleMessage->showAt ({ getLocalBounds().getCentreX(), 10, 1, 1 }, | |||
| attString, | |||
| 500, // numMillisecondsBeforeRemoving | |||
| true, // removeWhenMouseClicked | |||
| @@ -610,7 +689,7 @@ StringArray MainAppWindow::getRenderingEngines() const | |||
| { | |||
| StringArray renderingEngines; | |||
| if (ComponentPeer* peer = getPeer()) | |||
| if (auto* peer = getPeer()) | |||
| renderingEngines = peer->getAvailableRenderingEngines(); | |||
| #if JUCE_OPENGL | |||
| @@ -636,7 +715,7 @@ void MainAppWindow::setRenderingEngine (int index) | |||
| openGLContext.detach(); | |||
| #endif | |||
| if (ComponentPeer* peer = getPeer()) | |||
| if (auto* peer = getPeer()) | |||
| peer->setCurrentRenderingEngine (index); | |||
| } | |||
| @@ -652,7 +731,7 @@ int MainAppWindow::getActiveRenderingEngine() const | |||
| return getRenderingEngines().indexOf (openGLRendererName); | |||
| #endif | |||
| if (ComponentPeer* peer = getPeer()) | |||
| if (auto* peer = getPeer()) | |||
| return peer->getCurrentRenderingEngine(); | |||
| return 0; | |||
| @@ -81,11 +81,15 @@ public: | |||
| renderingEngineTwo = 0x2301, | |||
| renderingEngineThree = 0x2302, // these must be contiguous! | |||
| useLookAndFeelV1 = 0x200b, | |||
| useLookAndFeelV2 = 0x200c, | |||
| useLookAndFeelV3 = 0x200d, | |||
| toggleRepaintDebugging = 0x200e, | |||
| useLookAndFeelV1 = 0x300a, | |||
| useLookAndFeelV2 = 0x300b, | |||
| useLookAndFeelV3 = 0x300c, | |||
| useLookAndFeelV4Dark = 0x300d, | |||
| useLookAndFeelV4Midnight = 0x300e, | |||
| useLookAndFeelV4Grey = 0x300f, | |||
| useLookAndFeelV4Light = 0x3010, | |||
| toggleRepaintDebugging = 0x201a, | |||
| useNativeTitleBar = 0x201d, | |||
| goToKioskMode = 0x200f | |||
| @@ -22,7 +22,7 @@ public: | |||
| //============================================================================== | |||
| HelloWorldWindow() | |||
| : DocumentWindow ("JUCE Hello World!", | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons, | |||
| true) | |||
| { | |||
| @@ -70,7 +70,10 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) | |||
| : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons) | |||
| : DocumentWindow (name, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| setContentOwned (new MPETestClasses::MainComponent(), true); | |||
| @@ -38,7 +38,6 @@ public: | |||
| zoneLayoutComp (colourPicker), | |||
| visualiserComp (colourPicker) | |||
| { | |||
| setLookAndFeel (&lookAndFeel); | |||
| setSize (880, 720); | |||
| audioDeviceManager.initialise (0, 2, 0, true, String(), 0); | |||
| audioDeviceManager.addMidiInputCallback (String(), this); | |||
| @@ -175,7 +174,6 @@ private: | |||
| } | |||
| //============================================================================== | |||
| LookAndFeel_V3 lookAndFeel; | |||
| AudioDeviceManager audioDeviceManager; | |||
| MPEZoneLayout zoneLayout; | |||
| @@ -76,7 +76,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -72,13 +72,13 @@ public: | |||
| void paintListBoxItem (int rowNumber, Graphics &g, | |||
| int width, int height, bool rowIsSelected) override | |||
| { | |||
| const auto textColour = getLookAndFeel().findColour (ListBox::textColourId); | |||
| if (rowIsSelected) | |||
| g.fillAll (Colours::lightblue); | |||
| else if (rowNumber % 2) | |||
| g.fillAll (Colour (0xffeeeeee)); | |||
| g.fillAll (textColour.interpolatedWith (getLookAndFeel().findColour (ListBox::backgroundColourId), 0.5)); | |||
| g.setColour (Colours::black); | |||
| g.setColour (textColour); | |||
| g.setFont (height * 0.7f); | |||
| if (isInput) | |||
| @@ -209,9 +209,8 @@ MainContentComponent::~MainContentComponent() | |||
| } | |||
| //============================================================================== | |||
| void MainContentComponent::paint (Graphics& g) | |||
| void MainContentComponent::paint (Graphics&) | |||
| { | |||
| g.fillAll (Colours::white); | |||
| } | |||
| //============================================================================== | |||
| @@ -64,7 +64,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -64,7 +64,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -64,7 +64,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -63,7 +63,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow (String name) : DocumentWindow (name, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -60,11 +60,10 @@ public: | |||
| void render() override | |||
| { | |||
| jassert (OpenGLHelpers::isContextActive()); | |||
| const float desktopScale = (float) openGLContext.getRenderingScale(); | |||
| OpenGLHelpers::clear (Colour::greyLevel (0.1f)); | |||
| OpenGLHelpers::clear (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| glEnable (GL_BLEND); | |||
| glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |||
| @@ -92,7 +91,7 @@ public: | |||
| // You can add your component specific drawing code here! | |||
| // This will draw over the top of the openGL background. | |||
| g.setColour(Colours::white); | |||
| g.setColour (getLookAndFeel().findColour (Label::textColourId)); | |||
| g.setFont (20); | |||
| g.drawText ("OpenGL Example", 25, 20, 300, 30, Justification::left); | |||
| g.drawLine (20, 20, 170, 20); | |||
| @@ -52,7 +52,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow() : DocumentWindow (ProjectInfo::projectName, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -64,7 +64,6 @@ public: | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::black); | |||
| } | |||
| void resized() override | |||
| @@ -96,7 +96,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::white); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| } | |||
| //============================================================================== | |||
| @@ -30,7 +30,6 @@ public: | |||
| // Configure all the graphics for the transport control. | |||
| transportText.setColour (Label::textColourId, Colours::white); | |||
| transportText.setFont (Font (Font::getDefaultMonospacedFontName(), 18.0f, Font::plain)); | |||
| transportText.setJustificationType (Justification::topLeft); | |||
| addChildComponent (transportText); | |||
| @@ -56,7 +55,6 @@ public: | |||
| // Configure the switch to host button. | |||
| switchToHostButtonLabel.setColour (Label::textColourId, Colours::white); | |||
| switchToHostButtonLabel.setFont (Font (Font::getDefaultMonospacedFontName(), 18.0f, Font::plain)); | |||
| switchToHostButtonLabel.setJustificationType (Justification::centredRight); | |||
| switchToHostButtonLabel.setText ("Switch to\nhost app:", dontSendNotification); | |||
| @@ -76,12 +74,12 @@ public: | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::darkgrey); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| } | |||
| void resized() override | |||
| { | |||
| auto area = getBounds().reduced (10); | |||
| auto area = getBounds().reduced (20); | |||
| gainSlider.setBounds (area.removeFromLeft (60)); | |||
| @@ -254,7 +252,7 @@ private: | |||
| AudioProcessorValueTreeState& parameters; | |||
| const int buttonSize = 30; | |||
| const Colour defaultButtonColour = Colours::lightgrey; | |||
| const Colour defaultButtonColour = Colours::darkgrey; | |||
| ShapeButton rewindButton {"Rewind", defaultButtonColour, defaultButtonColour, defaultButtonColour}; | |||
| ShapeButton playButton {"Play", defaultButtonColour, defaultButtonColour, defaultButtonColour}; | |||
| ShapeButton recordButton {"Record", defaultButtonColour, defaultButtonColour, defaultButtonColour}; | |||
| @@ -16,17 +16,17 @@ public: | |||
| //============================================================================== | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll(Colours::transparentBlack); | |||
| g.fillAll (Colours::transparentBlack); | |||
| auto area = g.getClipBounds(); | |||
| g.setColour (Colours::skyblue); | |||
| g.fillRoundedRectangle(area.toFloat(), 6.0); | |||
| g.setColour (getLookAndFeel().findColour (Slider::thumbColourId)); | |||
| g.fillRoundedRectangle (area.toFloat(), 6.0); | |||
| auto unfilledHeight = area.getHeight() * (1.0 - level); | |||
| g.reduceClipRegion (area.getX(), area.getY(), | |||
| area.getWidth(), (int) unfilledHeight); | |||
| g.setColour (Colours::grey); | |||
| g.fillRoundedRectangle(area.toFloat(), 6.0); | |||
| g.setColour (getLookAndFeel().findColour (Slider::trackColourId)); | |||
| g.fillRoundedRectangle (area.toFloat(), 6.0); | |||
| } | |||
| void resized() override {} | |||
| @@ -74,7 +74,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.fillAll (Colours::white); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| } | |||
| void buttonClicked (Button* btn) override | |||
| @@ -127,11 +127,14 @@ public: | |||
| if (ChannelClickListener* listener = dynamic_cast<ChannelClickListener*> (getAudioProcessor())) | |||
| { | |||
| const auto activeColour = getLookAndFeel().findColour (Slider::thumbColourId); | |||
| const auto inactiveColour = getLookAndFeel().findColour (Slider::trackColourId); | |||
| for (int i = 0; i < activeChannels.size(); ++i) | |||
| { | |||
| bool isActive = listener->isChannelActive (i); | |||
| activeChannels.getReference (i) = isActive; | |||
| channelButtons [i]->setColour (TextButton::buttonColourId, isActive ? Colours::lightsalmon : Colours::lightgrey); | |||
| channelButtons [i]->setColour (TextButton::buttonColourId, isActive ? activeColour : inactiveColour); | |||
| channelButtons [i]->repaint(); | |||
| } | |||
| } | |||
| @@ -159,13 +162,16 @@ private: | |||
| { | |||
| if (ChannelClickListener* listener = dynamic_cast<ChannelClickListener*> (getAudioProcessor())) | |||
| { | |||
| const auto activeColour = getLookAndFeel().findColour (Slider::thumbColourId); | |||
| const auto inactiveColour = getLookAndFeel().findColour (Slider::trackColourId); | |||
| for (int i = 0; i < activeChannels.size(); ++i) | |||
| { | |||
| bool isActive = listener->isChannelActive (i); | |||
| if (activeChannels.getReference (i) != isActive) | |||
| { | |||
| activeChannels.getReference (i) = isActive; | |||
| channelButtons [i]->setColour (TextButton::buttonColourId, isActive ? Colours::lightsalmon : Colours::lightgrey); | |||
| channelButtons [i]->setColour (TextButton::buttonColourId, isActive ? activeColour : inactiveColour); | |||
| channelButtons [i]->repaint(); | |||
| } | |||
| } | |||
| @@ -49,7 +49,8 @@ public: | |||
| { | |||
| public: | |||
| MainWindow() : DocumentWindow (ProjectInfo::projectName, | |||
| Colours::lightgrey, | |||
| LookAndFeel::getDefaultLookAndFeel() | |||
| .findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| setUsingNativeTitleBar (true); | |||
| @@ -82,7 +82,6 @@ JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemo | |||
| // add a label that will display the current timecode and status.. | |||
| addAndMakeVisible (timecodeDisplayLabel); | |||
| timecodeDisplayLabel.setColour (Label::textColourId, Colours::blue); | |||
| timecodeDisplayLabel.setFont (Font (Font::getDefaultMonospacedFontName(), 15.0f, Font::plain)); | |||
| // set resize limits for this plug-in | |||
| @@ -103,8 +102,7 @@ JuceDemoPluginAudioProcessorEditor::~JuceDemoPluginAudioProcessorEditor() | |||
| //============================================================================== | |||
| void JuceDemoPluginAudioProcessorEditor::paint (Graphics& g) | |||
| { | |||
| g.setGradientFill (ColourGradient (Colours::white, 0, 0, | |||
| Colours::lightgrey, 0, (float) getHeight(), false)); | |||
| g.setColour (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| g.fillAll(); | |||
| } | |||
| @@ -117,8 +115,8 @@ void JuceDemoPluginAudioProcessorEditor::resized() | |||
| timecodeDisplayLabel.setBounds (r.removeFromTop (26)); | |||
| midiKeyboard.setBounds (r.removeFromBottom (70)); | |||
| r.removeFromTop (30); | |||
| Rectangle<int> sliderArea (r.removeFromTop (50)); | |||
| r.removeFromTop (20); | |||
| Rectangle<int> sliderArea (r.removeFromTop (60)); | |||
| gainSlider->setBounds (sliderArea.removeFromLeft (jmin (180, sliderArea.getWidth() / 2))); | |||
| delaySlider->setBounds (sliderArea.removeFromLeft (jmin (180, sliderArea.getWidth()))); | |||
| @@ -36,7 +36,8 @@ static Array <PluginWindow*> activePluginWindows; | |||
| PluginWindow::PluginWindow (Component* const pluginEditor, | |||
| AudioProcessorGraph::Node* const o, | |||
| WindowFormatType t) | |||
| : DocumentWindow (pluginEditor->getName(), Colours::lightblue, | |||
| : DocumentWindow (pluginEditor->getName(), | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::minimiseButton | DocumentWindow::closeButton), | |||
| owner (o), | |||
| type (t) | |||
| @@ -440,7 +441,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| g.setColour (Colours::lightgrey); | |||
| g.setColour (findColour (TextEditor::backgroundColourId)); | |||
| const int x = 4; | |||
| const int y = pinSize; | |||
| @@ -449,12 +450,9 @@ public: | |||
| g.fillRect (x, y, w, h); | |||
| g.setColour (Colours::black); | |||
| g.setColour (findColour (TextEditor::textColourId)); | |||
| g.setFont (font); | |||
| g.drawFittedText (getName(), getLocalBounds().reduced (4, 2), Justification::centred, 2); | |||
| g.setColour (Colours::grey); | |||
| g.drawRect (x, y, w, h); | |||
| } | |||
| void resized() override | |||
| @@ -839,7 +837,7 @@ GraphEditorPanel::~GraphEditorPanel() | |||
| void GraphEditorPanel::paint (Graphics& g) | |||
| { | |||
| g.fillAll (Colours::white); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| } | |||
| void GraphEditorPanel::mouseDown (const MouseEvent& e) | |||
| @@ -50,8 +50,6 @@ public: | |||
| appProperties = new ApplicationProperties(); | |||
| appProperties->setStorageParameters (options); | |||
| LookAndFeel::setDefaultLookAndFeel (&lookAndFeel); | |||
| mainWindow = new MainHostWindow(); | |||
| mainWindow->setUsingNativeTitleBar (true); | |||
| @@ -119,7 +117,6 @@ public: | |||
| ApplicationCommandManager commandManager; | |||
| ScopedPointer<ApplicationProperties> appProperties; | |||
| LookAndFeel_V3 lookAndFeel; | |||
| private: | |||
| ScopedPointer<MainHostWindow> mainWindow; | |||
| @@ -32,7 +32,8 @@ class MainHostWindow::PluginListWindow : public DocumentWindow | |||
| { | |||
| public: | |||
| PluginListWindow (MainHostWindow& owner_, AudioPluginFormatManager& pluginFormatManager) | |||
| : DocumentWindow ("Available Plugins", Colours::white, | |||
| : DocumentWindow ("Available Plugins", | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::minimiseButton | DocumentWindow::closeButton), | |||
| owner (owner_) | |||
| { | |||
| @@ -72,7 +73,8 @@ private: | |||
| //============================================================================== | |||
| MainHostWindow::MainHostWindow() | |||
| : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey, | |||
| : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| DocumentWindow::allButtons) | |||
| { | |||
| formatManager.addDefaultFormats(); | |||
| @@ -502,7 +504,7 @@ void MainHostWindow::showAudioSettings() | |||
| o.content.setNonOwned (&audioSettingsComp); | |||
| o.dialogTitle = "Audio Settings"; | |||
| o.componentToCentreAround = this; | |||
| o.dialogBackgroundColour = Colours::azure; | |||
| o.dialogBackgroundColour = getLookAndFeel().findColour (ResizableWindow::backgroundColourId); | |||
| o.escapeKeyTriggersCloseButton = true; | |||
| o.useNativeTitleBar = false; | |||
| o.resizable = false; | |||
| @@ -1269,8 +1269,7 @@ static const unsigned char temp_binary_data_4[] = | |||
| " void paint (Graphics& g) override\r\n" | |||
| " {\r\n" | |||
| " // (Our component is opaque, so we must completely fill the background with a solid colour)\r\n" | |||
| " g.fillAll (Colours::black);\r\n" | |||
| "\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));\r\n" | |||
| "\r\n" | |||
| " // You can add your drawing code here!\r\n" | |||
| " }\r\n" | |||
| @@ -1368,8 +1367,7 @@ static const unsigned char temp_binary_data_5[] = | |||
| " void paint (Graphics& g) override\r\n" | |||
| " {\r\n" | |||
| " // (Our component is opaque, so we must completely fill the background with a solid colour)\r\n" | |||
| " g.fillAll (Colours::black);\r\n" | |||
| "\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));\r\n" | |||
| "\r\n" | |||
| " // You can add your drawing code here!\r\n" | |||
| " }\r\n" | |||
| @@ -1428,9 +1426,10 @@ static const unsigned char temp_binary_data_6[] = | |||
| "//==============================================================================\r\n" | |||
| "void EDITORCLASSNAME::paint (Graphics& g)\r\n" | |||
| "{\r\n" | |||
| " g.fillAll (Colours::white);\r\n" | |||
| " // (Our component is opaque, so we must completely fill the background with a solid colour)\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::black);\r\n" | |||
| " g.setColour (Colours::white);\r\n" | |||
| " g.setFont (15.0f);\r\n" | |||
| " g.drawFittedText (\"Hello World!\", getLocalBounds(), Justification::centred, 1);\r\n" | |||
| "}\r\n" | |||
| @@ -1901,7 +1900,8 @@ static const unsigned char temp_binary_data_12[] = | |||
| "\r\n" | |||
| "void CONTENTCOMPCLASS::paint (Graphics& g)\r\n" | |||
| "{\r\n" | |||
| " g.fillAll (Colour (0xff001F36));\r\n" | |||
| " // (Our component is opaque, so we must completely fill the background with a solid colour)\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));\r\n" | |||
| "\r\n" | |||
| " g.setFont (Font (16.0f));\r\n" | |||
| " g.setColour (Colours::white);\r\n" | |||
| @@ -1975,12 +1975,12 @@ static const unsigned char temp_binary_data_14[] = | |||
| " {\r\n" | |||
| " // You should replace everything in this method with your own drawing code..\r\n" | |||
| "\r\n" | |||
| " g.fillAll (Colours::white); // clear the background\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::grey);\r\n" | |||
| " g.drawRect (getLocalBounds(), 1); // draw an outline around the component\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::lightblue);\r\n" | |||
| " g.setColour (Colours::white);\r\n" | |||
| " g.setFont (14.0f);\r\n" | |||
| " g.drawText (\"COMPONENTCLASS\", getLocalBounds(),\r\n" | |||
| " Justification::centred, true); // draw some placeholder text\r\n" | |||
| @@ -2333,12 +2333,12 @@ static const unsigned char temp_binary_data_19[] = | |||
| " drawing code..\r\n" | |||
| " */\r\n" | |||
| "\r\n" | |||
| " g.fillAll (Colours::white); // clear the background\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::grey);\r\n" | |||
| " g.drawRect (getLocalBounds(), 1); // draw an outline around the component\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::lightblue);\r\n" | |||
| " g.setColour (Colours::white);\r\n" | |||
| " g.setFont (14.0f);\r\n" | |||
| " g.drawText (\"COMPONENTCLASS\", getLocalBounds(),\r\n" | |||
| " Justification::centred, true); // draw some placeholder text\r\n" | |||
| @@ -2461,12 +2461,12 @@ static const unsigned char temp_binary_data_23[] = | |||
| " drawing code..\r\n" | |||
| " */\r\n" | |||
| "\r\n" | |||
| " g.fillAll (Colours::white); // clear the background\r\n" | |||
| " g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::grey);\r\n" | |||
| " g.drawRect (getLocalBounds(), 1); // draw an outline around the component\r\n" | |||
| "\r\n" | |||
| " g.setColour (Colours::lightblue);\r\n" | |||
| " g.setColour (Colours::white);\r\n" | |||
| " g.setFont (14.0f);\r\n" | |||
| " g.drawText (\"COMPONENTCLASS\", getLocalBounds(),\r\n" | |||
| " Justification::centred, true); // draw some placeholder text\r\n" | |||
| @@ -5235,26 +5235,26 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw | |||
| case 0x10b04d10: numBytes = 4971; return gradlew; | |||
| case 0x76cff066: numBytes = 2404; return gradlew_bat; | |||
| case 0x34bc1021: numBytes = 11325; return LICENSE; | |||
| case 0x6cf2645e: numBytes = 1838; return jucer_AnimatedComponentTemplate_cpp; | |||
| case 0xafccbd3f: numBytes = 3092; return jucer_AudioComponentTemplate_cpp; | |||
| case 0x27c5a93a: numBytes = 1162; return jucer_AudioPluginEditorTemplate_cpp; | |||
| case 0x6cf2645e: numBytes = 1887; return jucer_AnimatedComponentTemplate_cpp; | |||
| case 0xafccbd3f: numBytes = 3141; return jucer_AudioComponentTemplate_cpp; | |||
| case 0x27c5a93a: numBytes = 1310; return jucer_AudioPluginEditorTemplate_cpp; | |||
| case 0x4d0721bf: numBytes = 938; return jucer_AudioPluginEditorTemplate_h; | |||
| case 0x51b49ac5: numBytes = 5469; return jucer_AudioPluginFilterTemplate_cpp; | |||
| case 0x488afa0a: numBytes = 2203; return jucer_AudioPluginFilterTemplate_h; | |||
| case 0xabad7041: numBytes = 2151; return jucer_ComponentTemplate_cpp; | |||
| case 0xfc72fe86: numBytes = 2064; return jucer_ComponentTemplate_h; | |||
| case 0x0b66646c: numBytes = 886; return jucer_ContentCompTemplate_cpp; | |||
| case 0x0b66646c: numBytes = 1029; return jucer_ContentCompTemplate_cpp; | |||
| case 0x6fa10171: numBytes = 886; return jucer_ContentCompTemplate_h; | |||
| case 0x28d496ad: numBytes = 1161; return jucer_InlineComponentTemplate_h; | |||
| case 0x28d496ad: numBytes = 1208; return jucer_InlineComponentTemplate_h; | |||
| case 0x8905395b: numBytes = 470; return jucer_MainConsoleAppTemplate_cpp; | |||
| case 0x5e5ea047: numBytes = 1992; return jucer_MainTemplate_NoWindow_cpp; | |||
| case 0xda2391f8: numBytes = 4001; return jucer_MainTemplate_SimpleWindow_cpp; | |||
| case 0x400bc026: numBytes = 3913; return jucer_MainTemplate_Window_cpp; | |||
| case 0xf4842835: numBytes = 1389; return jucer_NewComponentTemplate_cpp; | |||
| case 0xf4842835: numBytes = 1436; return jucer_NewComponentTemplate_cpp; | |||
| case 0xe7bf237a: numBytes = 610; return jucer_NewComponentTemplate_h; | |||
| case 0x02a2a077: numBytes = 262; return jucer_NewCppFileTemplate_cpp; | |||
| case 0x0842c43c: numBytes = 246; return jucer_NewCppFileTemplate_h; | |||
| case 0x36e634a1: numBytes = 1588; return jucer_NewInlineComponentTemplate_h; | |||
| case 0x36e634a1: numBytes = 1635; return jucer_NewInlineComponentTemplate_h; | |||
| case 0x7fbac252: numBytes = 1716; return jucer_OpenGLComponentTemplate_cpp; | |||
| case 0x406db5c1: numBytes = 3117; return background_logo_svg; | |||
| case 0x4a0cfd09: numBytes = 151; return background_tile_png; | |||
| @@ -21,13 +21,13 @@ namespace BinaryData | |||
| const int LICENSESize = 11325; | |||
| extern const char* jucer_AnimatedComponentTemplate_cpp; | |||
| const int jucer_AnimatedComponentTemplate_cppSize = 1838; | |||
| const int jucer_AnimatedComponentTemplate_cppSize = 1887; | |||
| extern const char* jucer_AudioComponentTemplate_cpp; | |||
| const int jucer_AudioComponentTemplate_cppSize = 3092; | |||
| const int jucer_AudioComponentTemplate_cppSize = 3141; | |||
| extern const char* jucer_AudioPluginEditorTemplate_cpp; | |||
| const int jucer_AudioPluginEditorTemplate_cppSize = 1162; | |||
| const int jucer_AudioPluginEditorTemplate_cppSize = 1310; | |||
| extern const char* jucer_AudioPluginEditorTemplate_h; | |||
| const int jucer_AudioPluginEditorTemplate_hSize = 938; | |||
| @@ -45,13 +45,13 @@ namespace BinaryData | |||
| const int jucer_ComponentTemplate_hSize = 2064; | |||
| extern const char* jucer_ContentCompTemplate_cpp; | |||
| const int jucer_ContentCompTemplate_cppSize = 886; | |||
| const int jucer_ContentCompTemplate_cppSize = 1029; | |||
| extern const char* jucer_ContentCompTemplate_h; | |||
| const int jucer_ContentCompTemplate_hSize = 886; | |||
| extern const char* jucer_InlineComponentTemplate_h; | |||
| const int jucer_InlineComponentTemplate_hSize = 1161; | |||
| const int jucer_InlineComponentTemplate_hSize = 1208; | |||
| extern const char* jucer_MainConsoleAppTemplate_cpp; | |||
| const int jucer_MainConsoleAppTemplate_cppSize = 470; | |||
| @@ -66,7 +66,7 @@ namespace BinaryData | |||
| const int jucer_MainTemplate_Window_cppSize = 3913; | |||
| extern const char* jucer_NewComponentTemplate_cpp; | |||
| const int jucer_NewComponentTemplate_cppSize = 1389; | |||
| const int jucer_NewComponentTemplate_cppSize = 1436; | |||
| extern const char* jucer_NewComponentTemplate_h; | |||
| const int jucer_NewComponentTemplate_hSize = 610; | |||
| @@ -78,7 +78,7 @@ namespace BinaryData | |||
| const int jucer_NewCppFileTemplate_hSize = 246; | |||
| extern const char* jucer_NewInlineComponentTemplate_h; | |||
| const int jucer_NewInlineComponentTemplate_hSize = 1588; | |||
| const int jucer_NewInlineComponentTemplate_hSize = 1635; | |||
| extern const char* jucer_OpenGLComponentTemplate_cpp; | |||
| const int jucer_OpenGLComponentTemplate_cppSize = 1716; | |||
| @@ -36,8 +36,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (Colours::black); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| // You can add your drawing code here! | |||
| } | |||
| @@ -65,8 +65,7 @@ public: | |||
| void paint (Graphics& g) override | |||
| { | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (Colours::black); | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| // You can add your drawing code here! | |||
| } | |||
| @@ -27,9 +27,10 @@ EDITORCLASSNAME::~EDITORCLASSNAME() | |||
| //============================================================================== | |||
| void EDITORCLASSNAME::paint (Graphics& g) | |||
| { | |||
| g.fillAll (Colours::white); | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| g.setColour (Colours::black); | |||
| g.setColour (Colours::white); | |||
| g.setFont (15.0f); | |||
| g.drawFittedText ("Hello World!", getLocalBounds(), Justification::centred, 1); | |||
| } | |||
| @@ -21,7 +21,8 @@ CONTENTCOMPCLASS::~CONTENTCOMPCLASS() | |||
| void CONTENTCOMPCLASS::paint (Graphics& g) | |||
| { | |||
| g.fillAll (Colour (0xff001F36)); | |||
| // (Our component is opaque, so we must completely fill the background with a solid colour) | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); | |||
| g.setFont (Font (16.0f)); | |||
| g.setColour (Colours::white); | |||
| @@ -17,12 +17,12 @@ public: | |||
| { | |||
| // You should replace everything in this method with your own drawing code.. | |||
| g.fillAll (Colours::white); // clear the background | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background | |||
| g.setColour (Colours::grey); | |||
| g.drawRect (getLocalBounds(), 1); // draw an outline around the component | |||
| g.setColour (Colours::lightblue); | |||
| g.setColour (Colours::white); | |||
| g.setFont (14.0f); | |||
| g.drawText ("COMPONENTCLASS", getLocalBounds(), | |||
| Justification::centred, true); // draw some placeholder text | |||
| @@ -32,12 +32,12 @@ void COMPONENTCLASS::paint (Graphics& g) | |||
| drawing code.. | |||
| */ | |||
| g.fillAll (Colours::white); // clear the background | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background | |||
| g.setColour (Colours::grey); | |||
| g.drawRect (getLocalBounds(), 1); // draw an outline around the component | |||
| g.setColour (Colours::lightblue); | |||
| g.setColour (Colours::white); | |||
| g.setFont (14.0f); | |||
| g.drawText ("COMPONENTCLASS", getLocalBounds(), | |||
| Justification::centred, true); // draw some placeholder text | |||
| @@ -38,12 +38,12 @@ public: | |||
| drawing code.. | |||
| */ | |||
| g.fillAll (Colours::white); // clear the background | |||
| g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); // clear the background | |||
| g.setColour (Colours::grey); | |||
| g.drawRect (getLocalBounds(), 1); // draw an outline around the component | |||
| g.setColour (Colours::lightblue); | |||
| g.setColour (Colours::white); | |||
| g.setFont (14.0f); | |||
| g.drawText ("COMPONENTCLASS", getLocalBounds(), | |||
| Justification::centred, true); // draw some placeholder text | |||
| @@ -79,7 +79,10 @@ public: | |||
| virtual StandaloneFilterWindow* createWindow() | |||
| { | |||
| return new StandaloneFilterWindow (getApplicationName(), Colours::white, appProperties.getUserSettings(), false); | |||
| return new StandaloneFilterWindow (getApplicationName(), | |||
| LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId), | |||
| appProperties.getUserSettings(), | |||
| false); | |||
| } | |||
| //============================================================================== | |||
| @@ -212,7 +212,7 @@ public: | |||
| o.content->setSize (500, 450); | |||
| o.dialogTitle = TRANS("Audio/MIDI Settings"); | |||
| o.dialogBackgroundColour = Colour (0xfff0f0f0); | |||
| o.dialogBackgroundColour = o.content->getLookAndFeel().findColour (ResizableWindow::backgroundColourId); | |||
| o.escapeKeyTriggersCloseButton = true; | |||
| o.useNativeTitleBar = true; | |||
| o.resizable = false; | |||
| @@ -396,7 +396,7 @@ public: | |||
| const String& preferredDefaultDeviceName = String(), | |||
| const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr) | |||
| : DocumentWindow (title, backgroundColour, DocumentWindow::minimiseButton | DocumentWindow::closeButton), | |||
| optionsButton ("options") | |||
| optionsButton ("Options") | |||
| { | |||
| setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); | |||
| @@ -34,8 +34,11 @@ public: | |||
| void paintRowBackground (Graphics& g, int /*rowNumber*/, int /*width*/, int /*height*/, bool rowIsSelected) override | |||
| { | |||
| if (rowIsSelected) | |||
| g.fillAll (owner.findColour (TextEditor::highlightColourId)); | |||
| const auto defaultColour = owner.findColour (ListBox::backgroundColourId); | |||
| const auto c = rowIsSelected ? defaultColour.interpolatedWith (owner.findColour (ListBox::textColourId), 0.5f) | |||
| : defaultColour; | |||
| g.fillAll (c); | |||
| } | |||
| enum | |||
| @@ -75,9 +78,10 @@ public: | |||
| if (text.isNotEmpty()) | |||
| { | |||
| const auto defaultTextColour = owner.findColour (ListBox::textColourId); | |||
| g.setColour (isBlacklisted ? Colours::red | |||
| : columnId == nameCol ? Colours::black | |||
| : Colours::grey); | |||
| : columnId == nameCol ? defaultTextColour | |||
| : defaultTextColour.interpolatedWith (Colours::transparentBlack, 0.3f)); | |||
| g.setFont (Font (height * 0.7f, Font::bold)); | |||
| g.drawFittedText (text, 4, 0, width - 6, height, Justification::centredLeft, 1, 0.9f); | |||
| } | |||
| @@ -770,13 +770,11 @@ public: | |||
| return items.size(); | |||
| } | |||
| void paintListBoxItem (int row, Graphics& g, int width, int height, bool rowIsSelected) override | |||
| void paintListBoxItem (int row, Graphics& g, int width, int height, bool) override | |||
| { | |||
| if (isPositiveAndBelow (row, items.size())) | |||
| { | |||
| if (rowIsSelected) | |||
| g.fillAll (findColour (TextEditor::highlightColourId) | |||
| .withMultipliedAlpha (0.3f)); | |||
| g.fillAll (findColour (ListBox::backgroundColourId)); | |||
| const String item (items [row]); | |||
| bool enabled = false; | |||
| @@ -93,7 +93,7 @@ LookAndFeel& Desktop::getDefaultLookAndFeel() noexcept | |||
| if (currentLookAndFeel == nullptr) | |||
| { | |||
| if (defaultLookAndFeel == nullptr) | |||
| defaultLookAndFeel = new LookAndFeel_V3(); | |||
| defaultLookAndFeel = new LookAndFeel_V4(); | |||
| currentLookAndFeel = defaultLookAndFeel; | |||
| } | |||
| @@ -206,6 +206,7 @@ extern bool juce_areThereAnyAlwaysOnTopWindows(); | |||
| #include "lookandfeel/juce_LookAndFeel_V2.cpp" | |||
| #include "lookandfeel/juce_LookAndFeel_V1.cpp" | |||
| #include "lookandfeel/juce_LookAndFeel_V3.cpp" | |||
| #include "lookandfeel/juce_LookAndFeel_V4.cpp" | |||
| #include "menus/juce_MenuBarComponent.cpp" | |||
| #include "menus/juce_MenuBarModel.cpp" | |||
| #include "menus/juce_PopupMenu.cpp" | |||
| @@ -282,6 +282,7 @@ class FlexBox; | |||
| #include "lookandfeel/juce_LookAndFeel_V2.h" | |||
| #include "lookandfeel/juce_LookAndFeel_V1.h" | |||
| #include "lookandfeel/juce_LookAndFeel_V3.h" | |||
| #include "lookandfeel/juce_LookAndFeel_V4.h" | |||
| #if JUCE_LINUX | |||
| #include "native/juce_linux_X11.h" | |||
| @@ -0,0 +1,238 @@ | |||
| /* | |||
| ============================================================================== | |||
| This file is part of the JUCE library. | |||
| Copyright (c) 2015 - ROLI Ltd. | |||
| Permission is granted to use this software under the terms of either: | |||
| a) the GPL v2 (or any later version) | |||
| b) the Affero GPL v3 | |||
| Details of these licenses can be found at: www.gnu.org/licenses | |||
| JUCE is distributed in the hope that it will be useful, but WITHOUT ANY | |||
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | |||
| A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |||
| ------------------------------------------------------------------------------ | |||
| To release a closed-source product which uses JUCE, commercial licenses are | |||
| available: visit www.juce.com for more information. | |||
| ============================================================================== | |||
| */ | |||
| #pragma once | |||
| class JUCE_API LookAndFeel_V4 : public LookAndFeel_V3 | |||
| { | |||
| public: | |||
| /** | |||
| A struct containing the set of colours to apply to the GUI | |||
| */ | |||
| class ColourScheme | |||
| { | |||
| public: | |||
| /** The standard set of colours to use. */ | |||
| enum UIColour | |||
| { | |||
| windowBackground = 0, | |||
| widgetBackground, | |||
| menuBackground, | |||
| outline, | |||
| defaultText, | |||
| defaultFill, | |||
| highlightedText, | |||
| highlightedFill, | |||
| menuText, | |||
| numColours | |||
| }; | |||
| template <typename... ItemColours> | |||
| ColourScheme (ItemColours... coloursToUse) | |||
| { | |||
| static_assert (sizeof... (coloursToUse) == numColours, "Must supply one colour for each UIColour item"); | |||
| const Colour c[] = { Colour (coloursToUse)... }; | |||
| for (int i = 0; i < numColours; ++i) | |||
| palette[i] = c[i]; | |||
| } | |||
| ColourScheme (const ColourScheme&) = default; | |||
| ColourScheme& operator= (const ColourScheme&) = default; | |||
| /** Returns a colour from the scheme */ | |||
| Colour getUIColour (UIColour colourToGet) const noexcept; | |||
| /** Sets a scheme colour. */ | |||
| void setUIColour (UIColour colourToSet, Colour newColour) noexcept; | |||
| /** Returns true if two ColourPalette objects contain the same colours. */ | |||
| bool operator== (const ColourScheme&) const noexcept; | |||
| /** Returns false if two ColourPalette objects contain the same colours. */ | |||
| bool operator!= (const ColourScheme&) const noexcept; | |||
| private: | |||
| Colour palette[numColours]; | |||
| }; | |||
| //============================================================================== | |||
| /** Creates a LookAndFeel_V4 object with a default colour scheme. */ | |||
| LookAndFeel_V4(); | |||
| /** Creates a LookAndFeel_V4 object with a given colour scheme. */ | |||
| LookAndFeel_V4 (ColourScheme); | |||
| /** Destructor. */ | |||
| ~LookAndFeel_V4(); | |||
| //============================================================================== | |||
| void setColourScheme (ColourScheme); | |||
| ColourScheme& getCurrentColourScheme() noexcept { return currentColourScheme; } | |||
| static ColourScheme getDarkColourScheme(); | |||
| static ColourScheme getMidnightColourScheme(); | |||
| static ColourScheme getGreyColourScheme(); | |||
| static ColourScheme getLightColourScheme(); | |||
| //============================================================================== | |||
| Button* createDocumentWindowButton (int) override; | |||
| void positionDocumentWindowButtons (DocumentWindow&, int, int, int, int, Button*, Button*, Button*, bool) override; | |||
| void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int, int, int, int, const Image*, bool) override; | |||
| //============================================================================== | |||
| void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour, | |||
| bool isMouseOverButton, bool isButtonDown) override; | |||
| void drawToggleButton (Graphics&, ToggleButton&, bool isMouseOverButton, bool isButtonDown) override; | |||
| void drawTickBox (Graphics&, Component&, | |||
| float x, float y, float w, float h, | |||
| bool ticked, bool isEnabled, bool isMouseOverButton, bool isButtonDown) override; | |||
| //============================================================================== | |||
| AlertWindow* createAlertWindow (const String& title, const String& message, | |||
| const String& button1, | |||
| const String& button2, | |||
| const String& button3, | |||
| AlertWindow::AlertIconType iconType, | |||
| int numButtons, Component* associatedComponent) override; | |||
| void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override; | |||
| int getAlertWindowButtonHeight() override; | |||
| Font getAlertWindowTitleFont() override; | |||
| Font getAlertWindowMessageFont() override; | |||
| Font getAlertWindowFont() override; | |||
| //============================================================================== | |||
| void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override; | |||
| bool isProgressBarOpaque (ProgressBar&) override { return false; } | |||
| //============================================================================== | |||
| int getDefaultScrollbarWidth() override; | |||
| void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical, | |||
| int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override; | |||
| //============================================================================== | |||
| Path getTickShape (float height) override; | |||
| Path getCrossShape (float height) override; | |||
| //============================================================================== | |||
| void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override; | |||
| void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override; | |||
| //============================================================================== | |||
| Button* createFileBrowserGoUpButton() override; | |||
| void layoutFileBrowserComponent (FileBrowserComponent&, | |||
| DirectoryContentsDisplayComponent*, | |||
| FilePreviewComponent*, | |||
| ComboBox* currentPathBox, | |||
| TextEditor* filenameBox, | |||
| Button* goUpButton) override; | |||
| void drawFileBrowserRow (Graphics&, int width, int height, | |||
| const String& filename, Image* icon, | |||
| const String& fileSizeDescription, const String& fileTimeDescription, | |||
| bool isDirectory, bool isItemSelected, int itemIndex, | |||
| DirectoryContentsDisplayComponent&) override; | |||
| //============================================================================== | |||
| void drawPopupMenuItem (Graphics&, const Rectangle<int>& area, | |||
| bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu, | |||
| const String& text, const String& shortcutKeyText, | |||
| const Drawable* icon, const Colour* textColour) override; | |||
| void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight, | |||
| int& idealWidth, int& idealHeight) override; | |||
| void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override; | |||
| void drawMenuBarItem (Graphics&, int width, int height, | |||
| int itemIndex, const String& itemText, | |||
| bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar, | |||
| MenuBarComponent&) override; | |||
| //============================================================================== | |||
| void drawComboBox (Graphics&, int width, int height, bool isButtonDown, | |||
| int buttonX, int buttonY, int buttonW, int buttonH, | |||
| ComboBox&) override; | |||
| Font getComboBoxFont (ComboBox&) override; | |||
| void positionComboBoxText (ComboBox&, Label&) override; | |||
| //============================================================================== | |||
| void drawLinearSlider (Graphics&, int x, int y, int width, int height, | |||
| float sliderPos, float minSliderPos, float maxSliderPos, | |||
| const Slider::SliderStyle, Slider&) override; | |||
| void drawRotarySlider (Graphics&, int x, int y, int width, int height, | |||
| float sliderPosProportional, float rotaryStartAngle, | |||
| float rotaryEndAngle, Slider&) override; | |||
| void drawPointer (Graphics&, float x, float y, float diameter, | |||
| const Colour&, int direction) noexcept; | |||
| //============================================================================== | |||
| void drawTooltip (Graphics&, const String& text, int width, int height) override; | |||
| //============================================================================== | |||
| void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area, | |||
| bool isMouseOver, bool isMouseDown, | |||
| ConcertinaPanel&, Component& panel) override; | |||
| //============================================================================== | |||
| void drawLevelMeter (Graphics&, int, int, float) override; | |||
| //============================================================================== | |||
| void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override; | |||
| void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height, | |||
| const String& text, ToolbarItemComponent&) override; | |||
| //============================================================================== | |||
| void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override; | |||
| void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override; | |||
| void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override; | |||
| Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override; | |||
| //============================================================================== | |||
| void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override; | |||
| //============================================================================== | |||
| void drawStretchableLayoutResizerBar (Graphics&, int, int, bool, bool, bool) override; | |||
| private: | |||
| //============================================================================== | |||
| void drawLinearProgressBar (Graphics&, ProgressBar&, int width, int height, double progress); | |||
| void drawCircularProgressBar (Graphics&, ProgressBar&, const String&); | |||
| int getPropertyComponentIndent (PropertyComponent&); | |||
| //============================================================================== | |||
| void initialiseColours(); | |||
| ColourScheme currentColourScheme; | |||
| //============================================================================== | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V4) | |||
| }; | |||