reformat
This commit is contained in:
@@ -60,25 +60,20 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget)
|
||||
c->sendMessage(textInput.toPlainText());
|
||||
prevMsg.append(textInput.toPlainText());
|
||||
event->accept();
|
||||
if(!(event->modifiers() == Qt::ControlModifier))
|
||||
{
|
||||
if (!(event->modifiers() == Qt::ControlModifier)) {
|
||||
textInput.setText(QString());
|
||||
prevIndex = 0;
|
||||
}
|
||||
else if(textInput.toPlainText() == prevMsg.at(prevMsg.size()-1))
|
||||
{
|
||||
} else if (textInput.toPlainText() == prevMsg.at(prevMsg.size() - 1)) {
|
||||
prevMsg.removeLast();
|
||||
}
|
||||
prevIndex = prevMsg.size();
|
||||
}
|
||||
else if(event->key() == Qt::Key_Up){
|
||||
if(prevMsg.size() && prevIndex){
|
||||
} else if (event->key() == Qt::Key_Up) {
|
||||
if (prevMsg.size() && prevIndex) {
|
||||
prevIndex--;
|
||||
textInput.setText(prevMsg.at(prevIndex));
|
||||
}
|
||||
}
|
||||
else if(event->key() == Qt::Key_Down){
|
||||
if(prevIndex != (prevMsg.size() - 1) && prevIndex != prevMsg.size()){
|
||||
} else if (event->key() == Qt::Key_Down) {
|
||||
if (prevIndex != (prevMsg.size() - 1) && prevIndex != prevMsg.size()) {
|
||||
prevIndex++;
|
||||
textInput.setText(prevMsg.at(prevIndex));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user