From 010fc1dc4428375628ba675b2d4de6ab3dd0dcd1 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 22 Sep 2020 22:43:24 +0200 Subject: [PATCH] tried to improve layout of items --- .../src/gui/Posted/BoardPostDisplayWidget.cpp | 47 +- .../src/gui/Posted/BoardPostDisplayWidget.ui | 793 +++++++++--------- 2 files changed, 450 insertions(+), 390 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp index ca8ea4850..066194568 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp @@ -61,16 +61,20 @@ BoardPostDisplayWidget::BoardPostDisplayWidget(const RsPostedPost& post, Display ui->arrowsLayout->addStretch(); ui->arrowsLayout->setAlignment(Qt::AlignTop); ui->verticalLayout_2->addStretch(); +// ui->verticalLayout_3->addStretch(); +// ui->verticalLayout_3->setAlignment(Qt::AlignTop); - if(display_flags & SHOW_COMMENTS) - { - ui->commentsWidget->setTokenService(rsPosted->getTokenService(),rsPosted); + adjustSize(); - std::set post_versions ; - post_versions.insert(post.mMeta.mMsgId) ; - - ui->commentsWidget->commentLoad(post.mMeta.mGroupId, post_versions,mPost.mMeta.mMsgId,true); - } +// if(display_flags & SHOW_COMMENTS) +// { +// ui->commentsWidget->setTokenService(rsPosted->getTokenService(),rsPosted); +// +// std::set post_versions ; +// post_versions.insert(post.mMeta.mMsgId) ; +// +// ui->commentsWidget->commentLoad(post.mMeta.mGroupId, post_versions,mPost.mMeta.mMsgId,true); +// } } void BoardPostDisplayWidget::setCommentsSize(int comNb) @@ -172,8 +176,8 @@ void BoardPostDisplayWidget::setup() case DISPLAY_MODE_COMPACT: { ui->pictureLabel_compact->show(); - ui->expandButton->hide(); - //ui->expandButton->show(); // always hide, since we have the photoview already + //ui->expandButton->hide(); + ui->expandButton->show(); // always hide, since we have the photoview already ui->pictureLabel->hide(); ui->notes->hide(); @@ -207,7 +211,7 @@ void BoardPostDisplayWidget::setup() if(!(mDisplayFlags & SHOW_COMMENTS)) { - ui->commentsWidget->hide(); + //ui->commentsWidget->hide(); ui->commentButton->setChecked(false); } else @@ -269,7 +273,7 @@ void BoardPostDisplayWidget::setup() QDateTime qtime; qtime.setTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); - QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs); + QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs) + " " + tr("ago"); ui->dateLabel->setText(timestamp2); ui->dateLabel->setToolTip(timestamp); @@ -377,7 +381,10 @@ void BoardPostDisplayWidget::setup() doc.setHtml(ui->notes->text()); if(doc.toPlainText().trimmed().isEmpty()) + { ui->notes->hide(); + ui->expandButton->hide(); + } // feed. //frame_comment->show(); @@ -385,9 +392,7 @@ void BoardPostDisplayWidget::setup() if (mPost.mComments) { - QString commentText = QString::number(mPost.mComments); - commentText += " "; - commentText += tr("Comments"); + QString commentText = tr("Comments (%1)").arg(QString::number(mPost.mComments)); ui->commentButton->setText(commentText); } else @@ -434,7 +439,17 @@ void BoardPostDisplayWidget::setup() void BoardPostDisplayWidget::doExpand(bool e) { - std::cerr << "Expanding" << std::endl; + std::cerr << "Expanding" << std::endl; + if(e) + { + //ui->notes->show(); + ui->pictureLabel_2->show(); + } + else + { + //ui->notes->hide(); + ui->pictureLabel_2->hide(); + } emit expand(mPost.mMeta.mMsgId,e); } diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.ui b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.ui index ae8bd01de..4d2eb6253 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.ui +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.ui @@ -6,12 +6,12 @@ 0 0 - 758 - 211 + 558 + 202 - + 0 0 @@ -22,26 +22,29 @@ - + 0 + + QLayout::SetMaximumSize + - 0 + 2 - 0 + 2 - 0 + 2 - 0 + 2 - + 0 0 @@ -52,332 +55,204 @@ QFrame::Raised - + + + 2 + + + QLayout::SetMaximumSize + + + 1 + + + 2 + + + 1 + + + 2 + - + + + 2 + + + 2 + + + 2 + + + 2 + - + - - - - - - 0 - 0 - - - - Vote up - - - - - - - :/images/up-arrow.png:/images/up-arrow.png - - - true - - - - - - - - 9 - - - - 0 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Vote down - - - - - - \/ - - - - :/images/down-arrow.png:/images/down-arrow.png - - - true - - - - - - - + 0 0 - - PictureLabel_compact + + Vote up - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + :/images/up-arrow.png:/images/up-arrow.png + + + true - - - QLayout::SetMinimumSize + + + + 9 + + + + 0 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Vote down + + + + + + \/ + + + + :/images/down-arrow.png:/images/down-arrow.png + + + true + + + + + + + + + + 0 + 0 + + + + PictureLabel_compact + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + 0 + 0 + + + + + Arial + 10 + 75 + true + + + + This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + 5 + + + 0 + + + 6 - - - 5 - - - 0 - - - 6 - - - - - - 0 - 0 - - - - - 50 - false - - - - Posted by - - - - - - - - 0 - 0 - - - - Signed by - - - true - - - - - - - - 0 - 0 - - - - You eyes only - - - true - - - - - - - - 24 - 16777215 - - - - Qt::NoFocus - - - Toggle Message Read Status - - - - :/images/message-state-unread.png:/images/message-state-unread.png - - - true - - - false - - - true - - - - - - - New - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - Comments - - - - :/images/comments.png:/images/comments.png - - - true - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - Share - - - - :/images/share.png:/images/share.png - - - true - - - - - - - Expand - - - - - - - :/images/expand.png:/images/expand.png - - - true - - - true - - - - - - - + - + 0 0 - Arial - 10 - 75 - true + 50 + false - This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + Posted by - - - TextLabel - - - true - - - true - - - - - + - + 0 0 - site + Signed by true @@ -385,82 +260,258 @@ - - - - - PictureLabel - - - true - - - - - - - Qt::Horizontal - - - - 268 - 17 - - - - - + + + + 0 + 0 + + + + You eyes only + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 70 + 20 + + + + + + + + + + + + + 24 + 16777215 + + + + Qt::NoFocus + + + Toggle Message Read Status + + + + :/images/message-state-unread.png:/images/message-state-unread.png + + + true + + + false + + + true + + + + + + + New + + + + + + + Share + + + + :/images/share.png:/images/share.png + + + true + + + + + + + Expand + + + + + + + :/images/expand.png:/images/expand.png + + + true + + + true + + + + + + + Comments + + + + :/images/comments.png:/images/comments.png + + + true + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + TextLabel + + + true + + + true + + + + + + + + 0 + 0 + + + + site + + + true + + + + + + + + + PictureLabel + + + true + + + + + + + Qt::Horizontal + + + + 268 + 17 + + + - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - TextLabel - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - - - - 0 - 1 - - - - + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + QLayout::SetMaximumSize + + + 1 + + + 2 + + + 1 + + + 2 + + + + + + 0 + 0 + + + + TextLabel + + + true + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + @@ -482,12 +533,6 @@ QLabel
util/ClickableLabel.h
- - GxsCommentDialog - QWidget -
gui/gxs/GxsCommentDialog.h
- 1 -