feat(gui): add GUI components and displays
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "Display.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
void Display::paint (juce::Graphics& g)
|
||||
{
|
||||
const auto b = getLocalBounds().toFloat();
|
||||
g.setColour (juce::Colours::black.withAlpha (0.45f));
|
||||
g.fillRoundedRectangle (b, 4.0f);
|
||||
g.setColour (theme::outline);
|
||||
g.drawRoundedRectangle (b.reduced (0.5f), 4.0f, 1.0f);
|
||||
|
||||
if (title.isNotEmpty())
|
||||
{
|
||||
g.setColour (theme::textDim);
|
||||
g.setFont (juce::Font (10.0f));
|
||||
g.drawText (title, 0, 3, getWidth(), 14, juce::Justification::centred, false);
|
||||
}
|
||||
|
||||
g.setColour (theme::accent);
|
||||
g.setFont (juce::Font (14.0f, juce::Font::bold));
|
||||
g.drawText (value, 0, title.isNotEmpty() ? 16 : 0, getWidth(), getHeight() - (title.isNotEmpty() ? 16 : 0),
|
||||
juce::Justification::centred, false);
|
||||
}
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user