mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use shortened count for unread badges in main menu.
This commit is contained in:
parent
4af02d3d00
commit
adb25d65c2
1 changed files with 3 additions and 7 deletions
|
@ -188,13 +188,11 @@ void AddUnreadBadge(
|
||||||
) | rpl::start_with_next([=](UnreadBadge badge) {
|
) | rpl::start_with_next([=](UnreadBadge badge) {
|
||||||
state->st.muted = badge.muted;
|
state->st.muted = badge.muted;
|
||||||
state->count = badge.count;
|
state->count = badge.count;
|
||||||
if (!badge.count) {
|
if (!state->count) {
|
||||||
state->widget.hide();
|
state->widget.hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state->string = (state->count > 99)
|
state->string = Lang::FormatCountToShort(state->count).string;
|
||||||
? "99+"
|
|
||||||
: QString::number(state->count);
|
|
||||||
state->widget.resize(CountUnreadBadgeSize(state->string, state->st));
|
state->widget.resize(CountUnreadBadgeSize(state->string, state->st));
|
||||||
if (state->widget.isHidden()) {
|
if (state->widget.isHidden()) {
|
||||||
state->widget.show();
|
state->widget.show();
|
||||||
|
@ -535,10 +533,8 @@ QString MainMenu::ToggleAccountsButton::computeUnreadBadge() const {
|
||||||
const auto state = OtherAccountsUnreadStateCurrent();
|
const auto state = OtherAccountsUnreadStateCurrent();
|
||||||
return state.allMuted
|
return state.allMuted
|
||||||
? QString()
|
? QString()
|
||||||
: (state.count > 99)
|
|
||||||
? u"99+"_q
|
|
||||||
: (state.count > 0)
|
: (state.count > 0)
|
||||||
? QString::number(state.count)
|
? Lang::FormatCountToShort(state.count).string
|
||||||
: QString();
|
: QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue