[Improvement] Always show edit timer
This commit is contained in:
parent
54c40e8cf0
commit
d5e7a4145a
1 changed files with 3 additions and 3 deletions
|
|
@ -7833,8 +7833,6 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
|||
auto editTimeLeft = (session().serverConfig().editTimeLimit * 1000LL) - timeSinceMessage;
|
||||
if (editTimeLeft < 2) {
|
||||
editTimeLeftText = qsl("0:00");
|
||||
} else if (editTimeLeft > kDisplayEditTimeWarningMs) {
|
||||
updateIn = static_cast<int>(qMin(editTimeLeft - kDisplayEditTimeWarningMs, qint64(kFullDayInMs)));
|
||||
} else {
|
||||
updateIn = static_cast<int>(editTimeLeft % 1000);
|
||||
if (!updateIn) {
|
||||
|
|
@ -7843,7 +7841,9 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
|||
++updateIn;
|
||||
|
||||
editTimeLeft = (editTimeLeft - 1) / 1000; // seconds
|
||||
editTimeLeftText = qsl("%1:%2").arg(editTimeLeft / 60).arg(editTimeLeft % 60, 2, 10, QChar('0'));
|
||||
editTimeLeftText = (editTimeLeft >= 3600
|
||||
? qsl("%1:%2:%3").arg(editTimeLeft / 3600).arg(editTimeLeft % 3600 / 60, 2, 10, QChar('0')).arg(editTimeLeft % 60, 2, 10, QChar('0'))
|
||||
: qsl("%1:%2").arg(editTimeLeft / 60).arg(editTimeLeft % 60, 2, 10, QChar('0')));
|
||||
}
|
||||
|
||||
// Restart timer only if we are sure that we've painted the whole timer.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue