From f482e681e38149d7a87d218f73ac03ff016ed33d Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 6 Jan 2020 01:28:20 +0100 Subject: [PATCH] fixing margins & hide notes field when its empty --- retroshare-gui/src/gui/Posted/PostedCardView.cpp | 6 +++++- retroshare-gui/src/gui/Posted/PostedCardView.ui | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.cpp b/retroshare-gui/src/gui/Posted/PostedCardView.cpp index f7f59a056..e5fd646ce 100644 --- a/retroshare-gui/src/gui/Posted/PostedCardView.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCardView.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #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) diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.ui b/retroshare-gui/src/gui/Posted/PostedCardView.ui index 8c6fe0e84..fa026e6f9 100644 --- a/retroshare-gui/src/gui/Posted/PostedCardView.ui +++ b/retroshare-gui/src/gui/Posted/PostedCardView.ui @@ -465,6 +465,15 @@ 0 + + 0 + + + 0 + + + 0 +