mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 23:25:15 +00:00
[Improvement] Always show edit timer
This commit is contained in:
committed by
Eric Kotato
parent
f7e828a91c
commit
b98c34e514
@@ -8846,8 +8846,6 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
|||||||
auto editTimeLeft = (session().serverConfig().editTimeLimit * 1000LL) - timeSinceMessage;
|
auto editTimeLeft = (session().serverConfig().editTimeLimit * 1000LL) - timeSinceMessage;
|
||||||
if (editTimeLeft < 2) {
|
if (editTimeLeft < 2) {
|
||||||
editTimeLeftText = u"0:00"_q;
|
editTimeLeftText = u"0:00"_q;
|
||||||
} else if (editTimeLeft > kDisplayEditTimeWarningMs) {
|
|
||||||
updateIn = static_cast<int>(qMin(editTimeLeft - kDisplayEditTimeWarningMs, qint64(kFullDayInMs)));
|
|
||||||
} else {
|
} else {
|
||||||
updateIn = static_cast<int>(editTimeLeft % 1000);
|
updateIn = static_cast<int>(editTimeLeft % 1000);
|
||||||
if (!updateIn) {
|
if (!updateIn) {
|
||||||
@@ -8856,7 +8854,9 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
|||||||
++updateIn;
|
++updateIn;
|
||||||
|
|
||||||
editTimeLeft = (editTimeLeft - 1) / 1000; // seconds
|
editTimeLeft = (editTimeLeft - 1) / 1000; // seconds
|
||||||
editTimeLeftText = u"%1:%2"_q.arg(editTimeLeft / 60).arg(editTimeLeft % 60, 2, 10, QChar('0'));
|
editTimeLeftText = (editTimeLeft >= 3600
|
||||||
|
? u"%1:%2:%3"_q.arg(editTimeLeft / 3600).arg(editTimeLeft % 3600 / 60, 2, 10, QChar('0')).arg(editTimeLeft % 60, 2, 10, QChar('0'))
|
||||||
|
: u"%1:%2"_q.arg(editTimeLeft / 60).arg(editTimeLeft % 60, 2, 10, QChar('0')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restart timer only if we are sure that we've painted the whole timer.
|
// Restart timer only if we are sure that we've painted the whole timer.
|
||||||
|
Reference in New Issue
Block a user