Fix ChatItem clipping (when selecting lines)
[quassel.git] / src / qtui / chatitem.cpp
index b04083b..a78d2f8 100644 (file)
@@ -265,7 +265,7 @@ void ChatItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
 void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
   Q_UNUSED(option); Q_UNUSED(widget);
 
-  //painter->setClipRect(boundingRect()); // no idea why QGraphicsItem clipping won't work
+  painter->setClipRect(boundingRect()); // no idea why QGraphicsItem clipping won't work
   qreal layoutWidth = layout()->minimumWidth();
   qreal offset = 0;
   if(chatScene()->senderCutoffMode() == ChatScene::CutoffLeft)
@@ -534,7 +534,9 @@ void ContentsChatItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
 }
 
 void ContentsChatItem::showWebPreview(const Clickable &click) {
-#ifdef HAVE_WEBKIT
+#ifndef HAVE_WEBKIT
+  Q_UNUSED(click);
+#else
   QTextLine line = layout()->lineForTextPosition(click.start);
   qreal x = line.cursorToX(click.start);
   qreal width = line.cursorToX(click.start + click.length) - x;