From d122b3f1e592cb45a70bab2e765410169c126a04 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 6 Oct 2020 20:21:17 +0200 Subject: [PATCH] Fxed to get work Copy RetroShare Link *Fxed to get work Copy RetroShare Link *Fxing margins for compact ui *Fixing darkstylsheets --- .../src/gui/Posted/BoardPostDisplayWidget.cpp | 18 ++++++++++++++++++ .../src/gui/Posted/BoardPostDisplayWidget.h | 1 + .../Posted/BoardPostDisplayWidget_compact.ui | 10 ++++++++-- retroshare-gui/src/qss/qdarkstyle-v2.qss | 6 ++++++ retroshare-gui/src/qss/qdarkstyle.qss | 7 +++++++ 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp index 514ae5fcf..259740740 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include "rshare.h" #include "BoardPostDisplayWidget.h" #include "PhotoView.h" +#include "gui/RetroShareLink.h" #include "gui/gxs/GxsIdDetails.h" #include "util/misc.h" #include "gui/common/FilesDefs.h" @@ -165,6 +167,22 @@ void BoardPostDisplayWidgetBase::showAuthorInPeople() idDialog->navigate(RsGxsId(mPost.mMeta.mAuthorId)); } +void BoardPostDisplayWidgetBase::copyMessageLink() +{ + if (mPost.mMeta.mGroupId.isNull() || mPost.mMeta.mMsgId.isNull()) { + return; + } + + RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_POSTED, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, QString::fromUtf8(mPost.mMeta.mMsgName.c_str())); + + if (link.valid()) { + QList urls; + urls.push_back(link); + RSLinkClipboard::copyLinks(urls); + QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ; + } +} + void BoardPostDisplayWidgetBase::setup() { // show/hide things based on the view type diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h index 03db04970..83e8d4eaa 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h @@ -84,6 +84,7 @@ protected slots: void loadComments(bool e); void showAuthorInPeople(); + void copyMessageLink(); void readToggled(); void setReadStatus(bool isNew, bool isUnread) ; void makeUpVote() ; diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget_compact.ui b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget_compact.ui index 304b3b446..21fa7d87c 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget_compact.ui +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget_compact.ui @@ -183,6 +183,9 @@ + + 3 + @@ -219,10 +222,13 @@ - 5 + 6 - 0 + 2 + + + 2 6 diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index feadf4884..6a86212c5 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -2150,6 +2150,12 @@ BoardPostDisplayWidget_card QFrame#mainFrame[new=true] { background-color: #1464a0; } +BoardPostDisplayWidget_compact QLabel#titleLabel, +BoardPostDisplayWidget_card QLabel#titleLabel{ + font-size: 14px; + font: bold; +} + WireGroupItem QFrame#wire_frame{ background: transparent; } diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index d7e1a38e8..6f8f2a0a7 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -1317,6 +1317,13 @@ BoardPostDisplayWidget_card QLabel#newLabel { color: black; } +BoardPostDisplayWidget_compact QLabel#titleLabel, +BoardPostDisplayWidget_card QLabel#titleLabel{ + font-size: 14px; + font: bold; +} + + WireGroupItem QFrame#wire_frame { border: 1px solid #38444d;