Fixed moving cursor to begin/end when using reply shortcuts for macOS.

This commit is contained in:
23rd 2019-11-06 23:11:56 +03:00 committed by John Preston
parent be06d68468
commit 1ef877d9a5

View File

@ -3610,8 +3610,20 @@ bool HistoryWidget::eventFilter(QObject *obj, QEvent *e) {
const auto k = static_cast<QKeyEvent*>(e);
if ((k->modifiers() & kCommonModifiers) == Qt::ControlModifier) {
if (k->key() == Qt::Key_Up) {
#ifdef Q_OS_MAC
// Cmd + Up is used instead of Home.
if (!_field->textCursor().atStart()) {
return false;
}
#endif
return replyToPreviousMessage();
} else if (k->key() == Qt::Key_Down) {
#ifdef Q_OS_MAC
// Cmd + Down is used instead of End.
if (!_field->textCursor().atEnd()) {
return false;
}
#endif
return replyToNextMessage();
}
}