From 9ce886cfb676a9c6ec2e558001a7b369c4c6a00d Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 15 Nov 2020 18:30:52 +0100 Subject: [PATCH] Added back to display comments counts on the comments button --- .../src/gui/Posted/BoardPostDisplayWidget.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp index 5594d47a0..d454d8dd3 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp @@ -60,29 +60,25 @@ BoardPostDisplayWidgetBase::BoardPostDisplayWidgetBase(const RsPostedPost& post, void BoardPostDisplayWidgetBase::setCommentsSize(int comNb) { - QString sComButText ; + QString sComButText = tr("Comment"); + QString sComButTooltip ; if (comNb == 1) sComButText = tr("1 comment"); else if(comNb > 1) sComButText = tr("%1 comments").arg(comNb); - else - sComButText = tr("No comments yet. Click to add one."); - commentButton()->setToolTip(sComButText); + if (comNb == 0) + sComButTooltip = tr("No comments yet. Click to add one."); + + commentButton()->setToolTip(sComButTooltip); + commentButton()->setText(sComButText); if(comNb > 0) commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments_blue.png")); else commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments.png")); -// QString sComButText = tr("Comment"); -// if (comNb == 1) -// sComButText = sComButText.append("(1)"); -// else if(comNb > 1) -// sComButText = tr("Comments ").append("(%1)").arg(comNb); -// - commentButton()->setText(tr("Comments")); } void BoardPostDisplayWidgetBase::makeDownVote()