diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 2fa1f3b1e..a99e815c7 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -25,6 +25,7 @@ #include #include +#include "gui/common/RSElidedItemDelegate.h" #include "gui/gxs/GxsCommentTreeWidget.h" #include "gui/gxs/GxsCreateCommentDialog.h" #include "gui/gxs/GxsIdTreeWidgetItem.h" @@ -57,6 +58,10 @@ GxsCommentTreeWidget::GxsCommentTreeWidget(QWidget *parent) // QTreeWidget* widget = this; setContextMenuPolicy(Qt::CustomContextMenu); + RSElidedItemDelegate *itemDelegate = new RSElidedItemDelegate(this); + itemDelegate->setSpacing(QSize(0, 2)); + setItemDelegate(itemDelegate); + setWordWrap(true); // QFont font = QFont("ARIAL", 10); // font.setBold(true); diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index a1e20e37c..500693df0 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -25,6 +25,8 @@ #include "GxsCreateCommentDialog.h" #include "ui_GxsCreateCommentDialog.h" +#include "util/HandleRichText.h" + #include #include @@ -45,7 +47,11 @@ void GxsCreateCommentDialog::createComment() { RsGxsComment comment; - comment.mComment = std::string(ui->commentTextEdit->document()->toPlainText().toUtf8()); + QString text = ui->commentTextEdit->toHtml(); + RsHtml::optimizeHtml(text); + std::string msg = text.toUtf8().constData(); + + comment.mComment = msg; comment.mMeta.mParentId = mParentId.second; comment.mMeta.mGroupId = mParentId.first; comment.mMeta.mThreadId = mThreadId;