From a177d456a114ccd2049f23b9770cbbb408750853 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 29 Dec 2020 23:43:24 +0100 Subject: [PATCH 1/3] More wire ui fixes * Added a Top Avatar Label when its a new Post. * Hide Top Avatar on replies * Wire stylesheet fixes. * Fixed place holder text cleanup --- .../src/gui/TheWire/PulseAddDialog.cpp | 11 +++-- .../src/gui/TheWire/PulseAddDialog.ui | 48 +++++++++++++++---- .../src/gui/TheWire/PulseMessage.ui | 9 +++- retroshare-gui/src/gui/TheWire/PulseReply.ui | 13 ----- .../src/gui/qss/stylesheet/Standard.qss | 11 ++++- 5 files changed, 64 insertions(+), 28 deletions(-) diff --git a/retroshare-gui/src/gui/TheWire/PulseAddDialog.cpp b/retroshare-gui/src/gui/TheWire/PulseAddDialog.cpp index 517088606..ee9c562a2 100644 --- a/retroshare-gui/src/gui/TheWire/PulseAddDialog.cpp +++ b/retroshare-gui/src/gui/TheWire/PulseAddDialog.cpp @@ -53,16 +53,17 @@ void PulseAddDialog::setGroup(RsWireGroup &group) ui.label_groupName->setText(QString::fromStdString(group.mMeta.mGroupName)); ui.label_idName->setText(QString::fromStdString(group.mMeta.mAuthorId.toStdString())); - if (mGroup.mHeadshot.mData ) + if (group.mHeadshot.mData ) { QPixmap pixmap; if (GxsIdDetails::loadPixmapFromData( - mGroup.mHeadshot.mData, - mGroup.mHeadshot.mSize, + group.mHeadshot.mData, + group.mHeadshot.mSize, pixmap,GxsIdDetails::ORIGINAL)) { pixmap = pixmap.scaled(50,50); ui.headshot->setPixmap(pixmap); + ui.topheadshot->setPixmap(pixmap); } } else @@ -70,6 +71,7 @@ void PulseAddDialog::setGroup(RsWireGroup &group) // default. QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/wire.png").scaled(50,50); ui.headshot->setPixmap(pixmap); + ui.topheadshot->setPixmap(pixmap); } mGroup = group; @@ -129,9 +131,11 @@ void PulseAddDialog::cleanup() ui.pushButton_Post->setEnabled(false); ui.pushButton_Post->setText(tr("Post")); + ui.textEdit_Pulse->setPlaceholderText(tr("Whats happening?")); ui.frame_input->setVisible(true); ui.widget_sentiment->setVisible(true); ui.pushButton_picture->show(); + ui.topheadshot->show(); // cleanup images. mImage1.clear(); @@ -171,6 +175,7 @@ void PulseAddDialog::setReplyTo(RsWirePulse &pulse, RsWirePulseSPtr pPulse, std: mReplyType = replyType; ui.frame_reply->setVisible(true); ui.pushButton_picture->show(); + ui.topheadshot->hide(); { PulseReply *reply = new PulseReply(NULL, pPulse); diff --git a/retroshare-gui/src/gui/TheWire/PulseAddDialog.ui b/retroshare-gui/src/gui/TheWire/PulseAddDialog.ui index b3a21352f..1b8fb24cc 100644 --- a/retroshare-gui/src/gui/TheWire/PulseAddDialog.ui +++ b/retroshare-gui/src/gui/TheWire/PulseAddDialog.ui @@ -14,6 +14,9 @@ + + 0 + 6 @@ -38,6 +41,9 @@ QFrame::Raised + + 0 + @@ -54,25 +60,18 @@ - Post From: + From: - - - - GroupLabel - - - - + IDLabel - + Qt::Horizontal @@ -85,6 +84,35 @@ + + + + GroupLabel + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + Head + + + true + + + diff --git a/retroshare-gui/src/gui/TheWire/PulseMessage.ui b/retroshare-gui/src/gui/TheWire/PulseMessage.ui index 0163b0122..40e684e60 100644 --- a/retroshare-gui/src/gui/TheWire/PulseMessage.ui +++ b/retroshare-gui/src/gui/TheWire/PulseMessage.ui @@ -49,7 +49,14 @@ - + + + + MS Sans Serif + 10 + + + diff --git a/retroshare-gui/src/gui/TheWire/PulseReply.ui b/retroshare-gui/src/gui/TheWire/PulseReply.ui index eb7390e7e..74b2a8b9e 100644 --- a/retroshare-gui/src/gui/TheWire/PulseReply.ui +++ b/retroshare-gui/src/gui/TheWire/PulseReply.ui @@ -139,19 +139,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 55c114b60..f6f1dd2a9 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -1116,10 +1116,14 @@ PulseAddDialog QTextEdit#textEdit_Pulse { background: white; } -PulseAddDialog QFrame#frame_input, QFrame#frame_reply { +PulseAddDialog QFrame#frame_input, QFrame#frame_reply, QFrame#frame { border: 0px; } +PulseAddDialog QLabel#label_groupName { + font-size: 12pt; +} + PulseReply #line_replyLine , PulseMessage #line{ color: #7ecbfb; } @@ -1127,3 +1131,8 @@ PulseReply #line_replyLine , PulseMessage #line{ WireDialog QLabel#label_viewMode { font-size: 12pt; } + +WireGroupDialog QFrame#frame { + background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #9BDBF9, stop:1 #1592CD); + border: 0px; +} From daa724151bea825d0e38c08b51595c0439a00b1d Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 30 Dec 2020 01:31:27 +0100 Subject: [PATCH 2/3] Added to get view the attached Pulse images --- retroshare-gui/src/gui/Posted/PhotoView.cpp | 5 ++ retroshare-gui/src/gui/Posted/PhotoView.h | 1 + .../src/gui/TheWire/PulseMessage.cpp | 52 +++++++++++++++++++ retroshare-gui/src/gui/TheWire/PulseMessage.h | 7 +++ .../src/gui/TheWire/PulseMessage.ui | 27 ++++++++-- 5 files changed, 88 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PhotoView.cpp b/retroshare-gui/src/gui/Posted/PhotoView.cpp index 839e5f4d3..0c45914f4 100644 --- a/retroshare-gui/src/gui/Posted/PhotoView.cpp +++ b/retroshare-gui/src/gui/Posted/PhotoView.cpp @@ -101,3 +101,8 @@ void PhotoView::copyMessageLink() QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ; } } + +void PhotoView::setGroupNameString(const QString& name) +{ + ui->nameLabel->setText("@" + name); +} diff --git a/retroshare-gui/src/gui/Posted/PhotoView.h b/retroshare-gui/src/gui/Posted/PhotoView.h index d44406af3..dea6528d1 100644 --- a/retroshare-gui/src/gui/Posted/PhotoView.h +++ b/retroshare-gui/src/gui/Posted/PhotoView.h @@ -48,6 +48,7 @@ public slots: void setTime(const QString& text); void setGroupId(const RsGxsGroupId &groupId); void setMessageId(const RsGxsMessageId& messageId); + void setGroupNameString(const QString& name); private slots: void copyMessageLink(); diff --git a/retroshare-gui/src/gui/TheWire/PulseMessage.cpp b/retroshare-gui/src/gui/TheWire/PulseMessage.cpp index 91af09b3a..8f4a91873 100644 --- a/retroshare-gui/src/gui/TheWire/PulseMessage.cpp +++ b/retroshare-gui/src/gui/TheWire/PulseMessage.cpp @@ -19,6 +19,8 @@ *******************************************************************************/ #include "PulseMessage.h" +#include "gui/Posted/PhotoView.h" +#include "util/misc.h" /** Constructor */ @@ -26,6 +28,11 @@ PulseMessage::PulseMessage(QWidget *parent) :QWidget(parent) { setupUi(this); + + connect(label_image1, SIGNAL(clicked()), this, SLOT(viewPicture())); + connect(label_image2, SIGNAL(clicked()), this, SLOT(viewPicture())); + connect(label_image3, SIGNAL(clicked()), this, SLOT(viewPicture())); + connect(label_image4, SIGNAL(clicked()), this, SLOT(viewPicture())); } void PulseMessage::setup(RsWirePulseSPtr pulse) @@ -34,6 +41,8 @@ void PulseMessage::setup(RsWirePulseSPtr pulse) return; } + mPulse = pulse; + setMessage(QString::fromStdString(pulse->mPulseText)); // show indent if republish (both RESPONSE or REF) @@ -139,3 +148,46 @@ void PulseMessage::setRefImageCount(uint32_t count) } } +void PulseMessage::viewPicture() +{ + PhotoView *photoView = new PhotoView(this); + + if (!mPulse->mImage1.empty()) { + // install image. + QPixmap pixmap; + pixmap.loadFromData(mPulse->mImage1.mData, mPulse->mImage1.mSize); + photoView->setPixmap(pixmap); + } + + if (!mPulse->mImage2.empty()) { + // install image. + QPixmap pixmap; + pixmap.loadFromData(mPulse->mImage2.mData, mPulse->mImage2.mSize); + photoView->setPixmap(pixmap); + } + + if (!mPulse->mImage3.empty()) { + // install image. + QPixmap pixmap; + pixmap.loadFromData(mPulse->mImage3.mData, mPulse->mImage3.mSize); + photoView->setPixmap(pixmap); + } + + if (!mPulse->mImage4.empty()) { + // install image. + QPixmap pixmap; + pixmap.loadFromData(mPulse->mImage4.mData, mPulse->mImage4.mSize); + photoView->setPixmap(pixmap); + } + + QString timestamp = misc::timeRelativeToNow(mPulse->mRefPublishTs); + + photoView->setTitle(QString::fromStdString(mPulse->mPulseText)); + photoView->setGroupNameString(QString::fromStdString(mPulse->mRefGroupName)); + photoView->setTime(timestamp); + //photoView->setGroupId(mPulse->mRefGroupId); + + photoView->show(); + + /* window will destroy itself! */ +} diff --git a/retroshare-gui/src/gui/TheWire/PulseMessage.h b/retroshare-gui/src/gui/TheWire/PulseMessage.h index 7e94a23db..a2372ebbf 100644 --- a/retroshare-gui/src/gui/TheWire/PulseMessage.h +++ b/retroshare-gui/src/gui/TheWire/PulseMessage.h @@ -35,6 +35,13 @@ public: void setup(RsWirePulseSPtr pulse); void setMessage(QString msg); void setRefImageCount(uint32_t count); + +private slots: + void viewPicture(); + +private: + RsWirePulseSPtr mPulse; + }; #endif diff --git a/retroshare-gui/src/gui/TheWire/PulseMessage.ui b/retroshare-gui/src/gui/TheWire/PulseMessage.ui index 40e684e60..8af226cea 100644 --- a/retroshare-gui/src/gui/TheWire/PulseMessage.ui +++ b/retroshare-gui/src/gui/TheWire/PulseMessage.ui @@ -68,13 +68,16 @@ - + 128 128 + + Click to view picture + Image @@ -84,13 +87,16 @@ - + 128 128 + + Click to view picture + Image @@ -100,13 +106,16 @@ - + 128 128 + + Click to view picture + Image @@ -116,13 +125,16 @@ - + 128 128 + + Click to view picture + Image @@ -136,6 +148,13 @@ + + + ClickableLabel + QLabel +
util/ClickableLabel.h
+
+
From 73a0d5b56a089b1b5b646bc914b9694cd2ed3884 Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 30 Dec 2020 23:23:28 +0100 Subject: [PATCH 3/3] some ui fixes --- retroshare-gui/src/gui/TheWire/PulseReply.ui | 50 +++++++++++++++++++ .../src/gui/TheWire/WireGroupItem.ui | 6 +++ 2 files changed, 56 insertions(+) diff --git a/retroshare-gui/src/gui/TheWire/PulseReply.ui b/retroshare-gui/src/gui/TheWire/PulseReply.ui index 74b2a8b9e..1ffbbdf85 100644 --- a/retroshare-gui/src/gui/TheWire/PulseReply.ui +++ b/retroshare-gui/src/gui/TheWire/PulseReply.ui @@ -67,6 +67,12 @@ + + 0 + + + 0 + @@ -98,6 +104,12 @@ + + + MS Sans Serif + 10 + + retweeted @@ -137,6 +149,9 @@ + + 0 + @@ -424,6 +439,12 @@ + + + MS Sans Serif + 10 + + <html><head/><body><p><span style=" font-weight:600;">Sidler</span></p></body></html> @@ -431,6 +452,14 @@ + + + Segoe UI + 10 + 75 + true + + <html><head/><body><p><span style=" color:#555753;">@sidler_here</span></p></body></html> @@ -457,6 +486,12 @@ + + + MS Sans Serif + 10 + + <html><head/><body><p><span style=" color:#2e3436;">· Apr 13 ·</span></p></body></html> @@ -573,11 +608,26 @@ + + 0 + + + 0 + + + + MS Sans Serif + 10 + + <html><head/><body><p><span style=" color:#555753;">Replying to @sidler</span></p></body></html> + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse diff --git a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui index d6f7b86e0..db3ebc72b 100644 --- a/retroshare-gui/src/gui/TheWire/WireGroupItem.ui +++ b/retroshare-gui/src/gui/TheWire/WireGroupItem.ui @@ -55,6 +55,12 @@ + + + Segoe UI + 10 + + WireGroupName