fixed tabs being in weird positions at the start

This commit is contained in:
fourtf 2017-01-31 10:41:05 +01:00
parent c54f2c31dd
commit 9f7a674472
3 changed files with 19 additions and 4 deletions

View file

@ -503,8 +503,6 @@ Message::layout(int width, bool enableEmoteMargins)
std::vector<short> &charWidths = word.getCharacterWidthCache(); std::vector<short> &charWidths = word.getCharacterWidthCache();
auto xD = charWidths.size();
if (charWidths.size() == 0) { if (charWidths.size() == 0) {
for (int i = 0; i < text.length(); i++) { for (int i = 0; i < text.length(); i++) {
charWidths.push_back(metrics.charWidth(text, i)); charWidths.push_back(metrics.charWidth(text, i));

View file

@ -4,6 +4,7 @@
#include "ircmanager.h" #include "ircmanager.h"
#include "settings.h" #include "settings.h"
#include <QCompleter>
#include <QPainter> #include <QPainter>
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
@ -50,7 +51,17 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget)
this->setMessageLengthVisisble( this->setMessageLengthVisisble(
Settings::getInstance().showMessageLength.get()); 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) { if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
auto ptr = this->chatWidget->getChannel(); auto ptr = this->chatWidget->getChannel();
Channel *c = ptr.get(); Channel *c = ptr.get();
@ -62,6 +73,11 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget)
this->edit.setText(QString()); this->edit.setText(QString());
} }
} }
// else {
// completer->setCompletionPrefix("asdf");
// completer->complete();
// // completer->popup();
// }
}); });
/* XXX(pajlada): FIX THIS /* XXX(pajlada): FIX THIS

View file

@ -65,7 +65,8 @@ NotebookTab::moveAnimated(QPoint pos, bool animated)
posAnimationDesired = pos; posAnimationDesired = pos;
if (!animated || posAnimated == false) { if ((this->window() != NULL && !this->window()->isVisible()) || !animated ||
posAnimated == false) {
move(pos); move(pos);
posAnimated = true; posAnimated = true;