X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.cpp;h=a4582546a8bad425e28bfa7005395266b1154025;hp=f76cf2ae320132f3487f8fb157c50a2911dc370f;hb=99bb37d9938f3d88ce7551ded454146359fadc03;hpb=cc7f376eb105f7bf931fb7f96c9601a7b3f69511 diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index f76cf2ae..a4582546 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -28,10 +28,15 @@ #include "quasselui.h" ChatView::ChatView(Buffer *buf, QWidget *parent) : QGraphicsView(parent), AbstractChatView() { + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setOptimizationFlags(QGraphicsView::DontClipPainter + |QGraphicsView::DontSavePainterState + |QGraphicsView::DontAdjustForAntialiasing); _scene = new ChatScene(Client::messageModel(), this); + connect(_scene, SIGNAL(heightChanged(int)), this, SLOT(sceneHeightChanged(int))); + //_scene->setWidth(width()); setScene(_scene); - - //QGraphicsTextItem *item = scene()->addText(buf->bufferInfo().bufferName()); + setSceneRect(0, 0, width(), 0); } @@ -45,6 +50,14 @@ ChatScene *ChatView::scene() const { return _scene; } +void ChatView::resizeEvent(QResizeEvent *event) { + scene()->setWidth(event->size().width()); + qDebug() << "resize"; +} + +void ChatView::sceneHeightChanged(int h) { + setSceneRect(0, 0, width(), h); +} void ChatView::clear() {