mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
filetransferwidget.ui: reverted margins. chatlinecontentproxy: calculate
firstLineVOffset
This commit is contained in:
parent
b6fd9ed02e
commit
ba24da3184
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "chatlinecontentproxy.h"
|
||||
#include <QLayout>
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -61,7 +61,7 @@ FileTransferWidget::FileTransferWidget(QWidget *parent, ToxFile file)
|
|||
if(fileInfo.direction == ToxFile::SENDING)
|
||||
showPreview(fileInfo.filePath);
|
||||
|
||||
setFixedHeight(69);
|
||||
setFixedHeight(85);
|
||||
}
|
||||
|
||||
FileTransferWidget::~FileTransferWidget()
|
||||
|
|
|
@ -14,21 +14,6 @@
|
|||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="mainHorizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="sizePolicy">
|
||||
|
|
Loading…
Reference in New Issue
Block a user