X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=e20f3d636464641807aed3692ef021bf65735a96;hp=2f145e9a35a140c53c67874baba42e63cc20ff3b;hb=064dcac965d1e724a0434683685a24ec7e6ba855;hpb=f2fec057b3fa59cdf918fc6598ce208d4f8e8555 diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index 2f145e9a..e20f3d63 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -388,9 +388,15 @@ void ChatScene::updateForViewport(qreal width, qreal height) { void ChatScene::setWidth(qreal width) { if(width == _sceneRect.width()) return; + layout(width); +} +void ChatScene::layout(qreal width) { // clock_t startT = clock(); + if(width < 0) + width = _sceneRect.width(); + // disabling the index while doing this complex updates is about // 2 to 10 times faster! //setItemIndexMethod(QGraphicsScene::NoIndex);