diff --git a/messages/message.cpp b/messages/message.cpp index 09b9e6e3d..5cb45d109 100644 --- a/messages/message.cpp +++ b/messages/message.cpp @@ -503,8 +503,6 @@ Message::layout(int width, bool enableEmoteMargins) std::vector &charWidths = word.getCharacterWidthCache(); - auto xD = charWidths.size(); - if (charWidths.size() == 0) { for (int i = 0; i < text.length(); i++) { charWidths.push_back(metrics.charWidth(text, i)); diff --git a/widgets/chatwidgetinput.cpp b/widgets/chatwidgetinput.cpp index eee866ece..f903b109b 100644 --- a/widgets/chatwidgetinput.cpp +++ b/widgets/chatwidgetinput.cpp @@ -4,6 +4,7 @@ #include "ircmanager.h" #include "settings.h" +#include #include #include @@ -50,7 +51,17 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget) this->setMessageLengthVisisble( Settings::getInstance().showMessageLength.get()); - this->edit.keyPressed.connect([this](QKeyEvent *event) { + QStringList list; + list.append("asd"); + list.append("asdf"); + list.append("asdg"); + list.append("asdh"); + + QCompleter *completer = new QCompleter(list, &edit); + + completer->setWidget(&edit); + + this->edit.keyPressed.connect([this, completer](QKeyEvent *event) { if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { auto ptr = this->chatWidget->getChannel(); Channel *c = ptr.get(); @@ -62,6 +73,11 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget) this->edit.setText(QString()); } } + // else { + // completer->setCompletionPrefix("asdf"); + // completer->complete(); + // // completer->popup(); + // } }); /* XXX(pajlada): FIX THIS diff --git a/widgets/notebooktab.cpp b/widgets/notebooktab.cpp index 07b204306..fca50fd40 100644 --- a/widgets/notebooktab.cpp +++ b/widgets/notebooktab.cpp @@ -65,7 +65,8 @@ NotebookTab::moveAnimated(QPoint pos, bool animated) posAnimationDesired = pos; - if (!animated || posAnimated == false) { + if ((this->window() != NULL && !this->window()->isVisible()) || !animated || + posAnimated == false) { move(pos); posAnimated = true;