mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix IconGraphic::counterSlice for Window::WithSmallCounter
This commit is contained in:
parent
c672f105d3
commit
6f23010382
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue