new message line no longer grows with the item height
[quassel.git] / src / qtui / chatitem.h
index 8b677c3..b8b6e14 100644 (file)
@@ -146,6 +146,7 @@ public:
   ContentsChatItem(const qreal &width, const QPointF &pos, QGraphicsItem *parent);
 
   inline ChatLineModel::ColumnType column() const { return ChatLineModel::ContentsColumn; }
+  inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
 
 protected:
   virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
@@ -166,6 +167,9 @@ private:
 
   QList<Clickable> findClickables();
   void endHoverMode();
+  void showWebPreview(const Clickable &click);
+  void clearWebPreview();
+
 
   // WARNING: setGeometry and setHeight should not be used without either:
   //  a) calling prepareGeometryChange() immediately before setColumns()
@@ -174,7 +178,6 @@ private:
   friend class ChatLine;
   friend struct ContentsChatItemPrivate;
 
-  inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
   QFontMetricsF *_fontMetrics;
 };
 
@@ -197,13 +200,15 @@ struct ContentsChatItem::Clickable {
 };
 
 struct ContentsChatItemPrivate : ChatItemPrivate {
+  ContentsChatItem *contentsItem;
   QList<ContentsChatItem::Clickable> clickables;
   ContentsChatItem::Clickable currentClickable;
   bool hasDragged;
 
-  ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c) : ChatItemPrivate(l), clickables(c), hasDragged(false) {}
+  ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
 };
 
+
 //inlines regarding ContentsChatItemPrivate
 ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); }
 
@@ -222,9 +227,6 @@ private:
   qint16 wordidx;
   qint16 lineCount;
   qreal choppedTrailing;
-//   qint16 lastwrapcol;
-//   qreal lastwrappos;
-//   qreal width;
 };
 
 /*************************************************************************************************/