fixing margins & hide notes field when its empty

This commit is contained in:
defnax 2020-01-06 01:28:20 +01:00
parent b96fecfcbb
commit f482e681e3
2 changed files with 14 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include <QDateTime>
#include <QMenu>
#include <QStyle>
#include <QTextDocument>
#include "rshare.h"
#include "PostedCardView.h"
@ -332,7 +333,10 @@ void PostedCardView::fill()
// FIX THIS UP LATER.
ui->notes->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
if(ui->notes->text().isEmpty())
QTextDocument doc;
doc.setHtml(ui->notes->text());
if(doc.toPlainText().trimmed().isEmpty())
ui->notes->hide();
// differences between Feed or Top of Comment.
if (mFeedHolder)

View File

@ -465,6 +465,15 @@
<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="QLabel" name="pictureLabel">
<property name="text">