From fd7fe15e3133b0da184adbe54af91a67c384bb97 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Wed, 10 Dec 2014 16:45:12 +0100 Subject: [PATCH] renamed firstLineVOffset to getAscent --- src/chatlog/chatline.cpp | 4 ++-- src/chatlog/chatlinecontent.cpp | 2 +- src/chatlog/chatlinecontent.h | 2 +- src/chatlog/chatlinecontentproxy.cpp | 2 +- src/chatlog/chatlinecontentproxy.h | 2 +- src/chatlog/content/image.cpp | 2 +- src/chatlog/content/image.h | 2 +- src/chatlog/content/spinner.cpp | 2 +- src/chatlog/content/spinner.h | 2 +- src/chatlog/content/text.cpp | 2 +- src/chatlog/content/text.h | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/chatlog/chatline.cpp b/src/chatlog/chatline.cpp index c051b455d..928dcb7ca 100644 --- a/src/chatlog/chatline.cpp +++ b/src/chatlog/chatline.cpp @@ -160,7 +160,7 @@ void ChatLine::layout(qreal w, QPointF scenePos) for(int i = 0; i < content.size(); ++i) { - maxVOffset = qMax(maxVOffset, content[i]->firstLineVOffset()); + maxVOffset = qMax(maxVOffset, content[i]->getAscent()); // calculate the effective width of the current column qreal width; @@ -198,7 +198,7 @@ void ChatLine::layout(qreal w, QPointF scenePos) // vertical alignment may depend on width, so we do it in a second pass qreal yOffset = 0.0; - yOffset = maxVOffset - content[i]->firstLineVOffset(); + yOffset = maxVOffset - content[i]->getAscent(); // reposition content[i]->setPos(content[i]->pos().x(), content[i]->pos().y() + yOffset); diff --git a/src/chatlog/chatlinecontent.cpp b/src/chatlog/chatlinecontent.cpp index f6ba3b0ba..0250b3674 100644 --- a/src/chatlog/chatlinecontent.cpp +++ b/src/chatlog/chatlinecontent.cpp @@ -75,7 +75,7 @@ QString ChatLineContent::getSelectedText() const return QString(); } -qreal ChatLineContent::firstLineVOffset() const +qreal ChatLineContent::getAscent() const { return 0.0; } diff --git a/src/chatlog/chatlinecontent.h b/src/chatlog/chatlinecontent.h index da1249923..4796ac511 100644 --- a/src/chatlog/chatlinecontent.h +++ b/src/chatlog/chatlinecontent.h @@ -46,7 +46,7 @@ public: virtual QString getText() const; - virtual qreal firstLineVOffset() const; + virtual qreal getAscent() const; virtual QRectF boundingSceneRect() const = 0; virtual QRectF boundingRect() const = 0; diff --git a/src/chatlog/chatlinecontentproxy.cpp b/src/chatlog/chatlinecontentproxy.cpp index 72441cacc..dc12b96ed 100644 --- a/src/chatlog/chatlinecontentproxy.cpp +++ b/src/chatlog/chatlinecontentproxy.cpp @@ -40,7 +40,7 @@ void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsIt proxy->paint(painter, option, widget); } -qreal ChatLineContentProxy::firstLineVOffset() const +qreal ChatLineContentProxy::getAscent() const { return proxy->widget()->layout()->contentsMargins().top(); } diff --git a/src/chatlog/chatlinecontentproxy.h b/src/chatlog/chatlinecontentproxy.h index 3a0f9874b..d9686e96f 100644 --- a/src/chatlog/chatlinecontentproxy.h +++ b/src/chatlog/chatlinecontentproxy.h @@ -29,7 +29,7 @@ public: virtual QRectF boundingSceneRect() const; virtual void setWidth(qreal width); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - virtual qreal firstLineVOffset() const; + virtual qreal getAscent() const; private: QGraphicsProxyWidget* proxy; diff --git a/src/chatlog/content/image.cpp b/src/chatlog/content/image.cpp index 3885d7281..768a3418b 100644 --- a/src/chatlog/content/image.cpp +++ b/src/chatlog/content/image.cpp @@ -34,7 +34,7 @@ QRectF Image::boundingSceneRect() const return QRectF(scenePos(), size); } -qreal Image::firstLineVOffset() const +qreal Image::getAscent() const { return 0.0; } diff --git a/src/chatlog/content/image.h b/src/chatlog/content/image.h index ad84bd0fa..471596f6d 100644 --- a/src/chatlog/content/image.h +++ b/src/chatlog/content/image.h @@ -28,7 +28,7 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual void setWidth(qreal width); virtual QRectF boundingSceneRect() const; - virtual qreal firstLineVOffset() const; + virtual qreal getAscent() const; private: QSizeF size; diff --git a/src/chatlog/content/spinner.cpp b/src/chatlog/content/spinner.cpp index 642a92bed..a07d933e2 100644 --- a/src/chatlog/content/spinner.cpp +++ b/src/chatlog/content/spinner.cpp @@ -70,7 +70,7 @@ void Spinner::visibilityChanged(bool visible) timer.stop(); } -qreal Spinner::firstLineVOffset() const +qreal Spinner::getAscent() const { return 0.0; } diff --git a/src/chatlog/content/spinner.h b/src/chatlog/content/spinner.h index c2553dd67..6ab2e4b07 100644 --- a/src/chatlog/content/spinner.h +++ b/src/chatlog/content/spinner.h @@ -33,7 +33,7 @@ public: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual void setWidth(qreal width); virtual void visibilityChanged(bool visible); - virtual qreal firstLineVOffset() const; + virtual qreal getAscent() const; private slots: void timeout(); diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index f53b20d83..4b2e9e05c 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -170,7 +170,7 @@ void Text::visibilityChanged(bool visible) freeResources(); } -qreal Text::firstLineVOffset() const +qreal Text::getAscent() const { return vOffset; } diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index d218e72ae..4739abab2 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -47,7 +47,7 @@ public: virtual void visibilityChanged(bool isVisible) override; - virtual qreal firstLineVOffset() const override; + virtual qreal getAscent() const override; virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override; virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;