mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixes #288 arrow up behaviour
This commit is contained in:
parent
3484abd4af
commit
a1cd315ac8
|
@ -150,6 +150,7 @@ void SplitInput::installKeyPressedEvent()
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
if (!(event->modifiers() == Qt::ControlModifier)) {
|
if (!(event->modifiers() == Qt::ControlModifier)) {
|
||||||
|
this->currMsg = QString();
|
||||||
this->ui.textEdit->setText(QString());
|
this->ui.textEdit->setText(QString());
|
||||||
this->prevIndex = 0;
|
this->prevIndex = 0;
|
||||||
} else if (this->ui.textEdit->toPlainText() ==
|
} else if (this->ui.textEdit->toPlainText() ==
|
||||||
|
@ -170,8 +171,16 @@ void SplitInput::installKeyPressedEvent()
|
||||||
page->requestFocus(reqX, reqY);
|
page->requestFocus(reqX, reqY);
|
||||||
} else {
|
} else {
|
||||||
if (this->prevMsg.size() && this->prevIndex) {
|
if (this->prevMsg.size() && this->prevIndex) {
|
||||||
|
if (this->prevIndex == (this->prevMsg.size())) {
|
||||||
|
this->currMsg = ui.textEdit->toPlainText();
|
||||||
|
}
|
||||||
|
|
||||||
this->prevIndex--;
|
this->prevIndex--;
|
||||||
this->ui.textEdit->setText(this->prevMsg.at(this->prevIndex));
|
this->ui.textEdit->setText(this->prevMsg.at(this->prevIndex));
|
||||||
|
|
||||||
|
QTextCursor cursor = this->ui.textEdit->textCursor();
|
||||||
|
cursor.movePosition(QTextCursor::End);
|
||||||
|
this->ui.textEdit->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event->key() == Qt::Key_Down) {
|
} else if (event->key() == Qt::Key_Down) {
|
||||||
|
@ -192,8 +201,12 @@ void SplitInput::installKeyPressedEvent()
|
||||||
this->ui.textEdit->setText(this->prevMsg.at(this->prevIndex));
|
this->ui.textEdit->setText(this->prevMsg.at(this->prevIndex));
|
||||||
} else {
|
} else {
|
||||||
this->prevIndex = this->prevMsg.size();
|
this->prevIndex = this->prevMsg.size();
|
||||||
this->ui.textEdit->setText(QString());
|
this->ui.textEdit->setText(this->currMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTextCursor cursor = this->ui.textEdit->textCursor();
|
||||||
|
cursor.movePosition(QTextCursor::End);
|
||||||
|
this->ui.textEdit->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
} else if (event->key() == Qt::Key_Left) {
|
} else if (event->key() == Qt::Key_Left) {
|
||||||
if (event->modifiers() == Qt::AltModifier) {
|
if (event->modifiers() == Qt::AltModifier) {
|
||||||
|
|
|
@ -59,6 +59,7 @@ private:
|
||||||
// QLabel textLengthLabel;
|
// QLabel textLengthLabel;
|
||||||
// RippleEffectLabel emotesLabel;
|
// RippleEffectLabel emotesLabel;
|
||||||
QStringList prevMsg;
|
QStringList prevMsg;
|
||||||
|
QString currMsg;
|
||||||
int prevIndex = 0;
|
int prevIndex = 0;
|
||||||
|
|
||||||
void initLayout();
|
void initLayout();
|
||||||
|
|
Loading…
Reference in a new issue