[Improvement] Always show edit timer
This commit is contained in:
parent
0d5c21191e
commit
eaaed0850d
1 changed files with 7 additions and 4 deletions
|
|
@ -6315,7 +6315,10 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) {
|
||||||
.groupOptions = draft.groupOptions,
|
.groupOptions = draft.groupOptions,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Ui::showPeerHistory(_peer, _editMsgId ? _editMsgId : replyToId());
|
controller()->showPeerHistory(
|
||||||
|
_peer,
|
||||||
|
Window::SectionShow::Way::ClearStack,
|
||||||
|
_editMsgId ? _editMsgId : replyToId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8193,8 +8196,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 = qsl("0:00");
|
editTimeLeftText = qsl("0:00");
|
||||||
} 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) {
|
||||||
|
|
@ -8203,7 +8204,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 = 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.
|
// Restart timer only if we are sure that we've painted the whole timer.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue