Skip to content
Snippets Groups Projects
Commit 947a01f1 authored by jsiegle's avatar jsiegle
Browse files

Fixed bug in WiFiOutputEditor

Because the WiFiOutputEditor also had timerCallback() defined, it wasn't able to
fade in upon creation. This method was modified to solve the problem.
parent 9b870401
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,10 @@ public:
void fadeIn();
int radioGroupId;
bool isFading;
float accumulator;
private:
......@@ -103,9 +107,7 @@ private:
int tNum;
bool isFading;
float accumulator;
Font titleFont;
......
......@@ -61,14 +61,29 @@ void WiFiOutputEditor::receivedEvent()
void WiFiOutputEditor::timerCallback()
{
if (accumulator < 10)
{
icon->setOpacity(0.8f-(0.05*float(accumulator)));
accumulator++;
repaint();
accumulator++;
if (isFading) {
if (accumulator > 15.0)
{
stopTimer();
isFading = false;
}
} else {
icon->setOpacity(0.3f);
stopTimer();
accumulator = 0;
if (accumulator < 10.0)
{
icon->setOpacity(0.8f-(0.05*float(accumulator)));
accumulator++;
} else {
icon->setOpacity(0.3f);
stopTimer();
accumulator = 0;
}
}
}
\ No newline at end of file
......@@ -44,8 +44,6 @@ public:
private:
int accumulator;
void timerCallback();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WiFiOutputEditor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment