1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

added comment to explain this spaghetti

This commit is contained in:
agilob 2015-01-26 00:31:54 +00:00
parent d3cdebd46f
commit c9e96300b2
No known key found for this signature in database
GPG Key ID: 34568050DBCCB997

View File

@ -31,6 +31,14 @@ void ChatTextEdit::keyPressEvent(QKeyEvent * event)
emit enterPressed();
else if (key == Qt::Key_Tab)
emit tabPressed();
/**
If message box is empty, it will paste previous message on arrow up
if message box is not empty,
it will copy current(2) text and paste previous(1) message,
to paste previous message(2) press arrow down,
press arrow down twice to clear mesage box,
only previous message(1) is available to paste now.
*/
else if (key == Qt::Key_Up && this->toPlainText().isEmpty())
this->setText(lastMessage);
else if (key == Qt::Key_Up && !this->toPlainText().isEmpty())