From ba24da31847fa0eefb1bdb87586564f176c8bff5 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Wed, 10 Dec 2014 10:57:09 +0100 Subject: [PATCH] filetransferwidget.ui: reverted margins. chatlinecontentproxy: calculate firstLineVOffset --- src/chatlog/chatlinecontentproxy.cpp | 6 ++++++ src/chatlog/chatlinecontentproxy.h | 2 ++ src/chatlog/content/filetransferwidget.cpp | 2 +- src/chatlog/content/filetransferwidget.ui | 15 --------------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/chatlog/chatlinecontentproxy.cpp b/src/chatlog/chatlinecontentproxy.cpp index 8ac308ae1..a2d2b7817 100644 --- a/src/chatlog/chatlinecontentproxy.cpp +++ b/src/chatlog/chatlinecontentproxy.cpp @@ -15,6 +15,7 @@ */ #include "chatlinecontentproxy.h" +#include #include #include @@ -39,6 +40,11 @@ void ChatLineContentProxy::paint(QPainter *painter, const QStyleOptionGraphicsIt proxy->paint(painter, option, widget); } +qreal ChatLineContentProxy::firstLineVOffset() const +{ + return proxy->widget()->layout()->contentsMargins().top() + proxy->widget()->layout()->contentsMargins().bottom(); +} + void ChatLineContentProxy::setWidth(qreal width) { proxy->widget()->setFixedWidth(qMax(width,0.0)); diff --git a/src/chatlog/chatlinecontentproxy.h b/src/chatlog/chatlinecontentproxy.h index bf225a17c..3a0f9874b 100644 --- a/src/chatlog/chatlinecontentproxy.h +++ b/src/chatlog/chatlinecontentproxy.h @@ -29,9 +29,11 @@ public: virtual QRectF boundingSceneRect() const; virtual void setWidth(qreal width); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual qreal firstLineVOffset() const; private: QGraphicsProxyWidget* proxy; + }; #endif // CHATLINECONTENTPROXY_H diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index a2ff659f0..83f7e11a1 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -61,7 +61,7 @@ FileTransferWidget::FileTransferWidget(QWidget *parent, ToxFile file) if(fileInfo.direction == ToxFile::SENDING) showPreview(fileInfo.filePath); - setFixedHeight(69); + setFixedHeight(85); } FileTransferWidget::~FileTransferWidget() diff --git a/src/chatlog/content/filetransferwidget.ui b/src/chatlog/content/filetransferwidget.ui index b3d75d77f..e43b8c091 100644 --- a/src/chatlog/content/filetransferwidget.ui +++ b/src/chatlog/content/filetransferwidget.ui @@ -14,21 +14,6 @@ Form - - 0 - - - 0 - - - 0 - - - 0 - - - 0 -