-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add throttle label, lookandfeel, detection leds
- Loading branch information
1 parent
95180cd
commit ae34918
Showing
10 changed files
with
152 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
============================================================================== | ||
ReachLookAndFeel.cpp | ||
Created: 17 May 2018 12:44:57pm | ||
Author: Niccolo' | ||
============================================================================== | ||
*/ | ||
|
||
#include "../JuceLibraryCode/JuceHeader.h" | ||
#include "ReachLookAndFeel.h" | ||
|
||
//============================================================================== | ||
ReachLookAndFeel::ReachLookAndFeel() | ||
{ | ||
setupColours(); | ||
} | ||
|
||
ReachLookAndFeel::~ReachLookAndFeel() | ||
{ | ||
} | ||
|
||
void ReachLookAndFeel::setupColours() | ||
{ | ||
setColour(Label::backgroundColourId, Colours::white); | ||
setColour(Label::textColourId, Colours::black); | ||
setColour(Label::textWhenEditingColourId, Colours::black); | ||
} | ||
|
||
void ReachLookAndFeel::drawLabel(Graphics& g, Label& label) | ||
{ | ||
g.fillAll(label.findColour(Label::backgroundColourId)); | ||
|
||
if (!label.isBeingEdited()) | ||
{ | ||
auto alpha = label.isEnabled() ? 1.0f : 0.5f; | ||
const Font font(getLabelFont(label)); | ||
|
||
g.setColour(label.findColour(Label::textColourId).withMultipliedAlpha(alpha)); | ||
g.setFont(font); | ||
|
||
Rectangle<int> textArea(label.getBorderSize().subtractedFrom(label.getLocalBounds())); | ||
|
||
g.drawFittedText(label.getText(), textArea, Justification::centred, | ||
jmax(1, (int)(textArea.getHeight() / font.getHeight())), | ||
label.getMinimumHorizontalScale()); | ||
|
||
g.setColour(label.findColour(Label::outlineColourId).withMultipliedAlpha(alpha)); | ||
} | ||
else if (label.isEnabled()) | ||
{ | ||
g.setColour(label.findColour(Label::outlineColourId)); | ||
} | ||
|
||
g.drawRect(label.getLocalBounds()); | ||
} |
Oops, something went wrong.