Fix IconGraphic::counterSlice for Window::WithSmallCounter

This commit is contained in:
Ilya Fedin 2025-02-23 04:04:05 +00:00 committed by John Preston
parent c672f105d3
commit 6f23010382
2 changed files with 4 additions and 4 deletions

View file

@ -111,8 +111,8 @@ bool IconGraphic::isCounterNeeded(const State &state) const {
}
int IconGraphic::counterSlice(int counter) const {
return (counter >= 1000)
? (1000 + (counter % 100))
return (counter >= 100)
? (100 + (counter % 10))
: counter;
}

View file

@ -260,8 +260,6 @@ QIcon CreateIcon(Main::Session *session, bool returnNullIfDefault) {
}
QImage GenerateCounterLayer(CounterLayerArgs &&args) {
// platform/linux/main_window_linux depends on count used the same
// way for all the same (count % 1000) values.
const auto count = args.count.value();
const auto text = (count < 1000)
? QString::number(count)
@ -338,6 +336,8 @@ QImage GenerateCounterLayer(CounterLayerArgs &&args) {
}
QImage WithSmallCounter(QImage image, CounterLayerArgs &&args) {
// platform/linux/tray_linux depends on count used the same
// way for all the same (count % 100) values.
const auto count = args.count.value();
const auto text = (count < 100)
? QString::number(count)