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:
@@ -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 }),
|
||||
|
Reference in New Issue
Block a user