2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Unified general phrases for duration.

This commit is contained in:
23rd
2022-03-31 19:45:11 +03:00
committed by John Preston
parent fb750b69e3
commit d9541b6a6e
17 changed files with 61 additions and 153 deletions

View File

@@ -137,10 +137,7 @@ void ActionWithTimer::refreshAutoDeleteText() {
const auto left = (_destroyAt > now) ? (_destroyAt - now) : 0;
const auto text = [&] {
const auto duration = (left >= 86400)
? tr::lng_group_call_duration_days(
tr::now,
lt_count,
((left + 43200) / 86400))
? tr::lng_days(tr::now, lt_count, ((left + 43200) / 86400))
: (left >= 3600)
? QString("%1:%2:%3"
).arg(left / 3600
@@ -191,10 +188,7 @@ void ActionWithTimer::prepare() {
+ padding.right();
};
const auto maxWidth1 = ttlMaxWidth("23:59:59");
const auto maxWidth2 = ttlMaxWidth(tr::lng_group_call_duration_days(
tr::now,
lt_count,
7));
const auto maxWidth2 = ttlMaxWidth(tr::lng_days(tr::now, lt_count, 7));
const auto w = std::clamp(
std::max({ goodWidth, maxWidth1, maxWidth2 }),