1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Added a new LookAndFeel (V4) and re-skinned the JUCE Demo and examples. Improved the JUCE Demo on mobile devices.

This commit is contained in:
hogliux 2017-04-27 12:21:41 +01:00
parent 3b422bef51
commit ef2c63e4e3
99 changed files with 5037 additions and 433 deletions

View file

@ -96,7 +96,7 @@ public:
void paint (Graphics& g) override
{
g.fillAll (Colours::white);
g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
}
//==============================================================================

View file

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

View file

@ -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 {}

View file

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