Skip to content

Commit

Permalink
Fix inverted blinking speed when fade is enabled
Browse files Browse the repository at this point in the history
Also make the total time of one blink operation the same
regardless of whether fading is enabled or not.
The slowest blink is 3 seconds for both.
  • Loading branch information
Abestanis committed Feb 22, 2021
1 parent 20c6a5b commit ee4b57d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/trayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ void TrayIcon::enableBlinking(bool enabled)

// If we are using the alpha transition, we have to update icon more often
if (settings->mBlinkingUseAlphaTransition) {
mBlinkingDelta = settings->mBlinkSpeed / 100.0;
mBlinkingTimeout = 100;
mBlinkingDelta = std::min(1.0, (2.0 / settings->mBlinkSpeed));
mBlinkingTimeout = settings->mBlinkSpeed == 1 ? 50 : 100;
} else {
// The blinking speed slider is a value from 0 to 30, so we make it 50x
// The blinking speed slider is a value from 0 to 30,
// so we make it 50x so the maximum is 1500 ms.
mBlinkingDelta = 0;
mBlinkingTimeout = settings->mBlinkSpeed * 50;
}
Expand Down

0 comments on commit ee4b57d

Please sign in to comment.