Merge pull request #2193 from defnax/wire-ui-fixes-5

Wire ui fixes
This commit is contained in:
defnax 2020-12-31 13:27:57 +01:00 committed by GitHub
commit bfcfff4d0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 208 additions and 32 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -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);

View File

@ -14,6 +14,9 @@
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
@ -38,6 +41,9 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
@ -54,25 +60,18 @@
</font>
</property>
<property name="text">
<string>Post From:</string>
<string>From:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_groupName">
<property name="text">
<string>GroupLabel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="3">
<widget class="GxsIdLabel" name="label_idName">
<property name="text">
<string>IDLabel</string>
</property>
</widget>
</item>
<item row="0" column="3">
<item row="0" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -85,6 +84,35 @@
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_groupName">
<property name="text">
<string>GroupLabel</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="topheadshot">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>Head</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -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! */
}

View File

@ -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

View File

@ -49,7 +49,14 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QTextBrowser" name="textBrowser"/>
<widget class="QTextBrowser" name="textBrowser">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame_expand">
@ -61,13 +68,16 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_image1">
<widget class="ClickableLabel" name="label_image1">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -77,13 +87,16 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_image2">
<widget class="ClickableLabel" name="label_image2">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -93,13 +106,16 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_image3">
<widget class="ClickableLabel" name="label_image3">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -109,13 +125,16 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_image4">
<widget class="ClickableLabel" name="label_image4">
<property name="minimumSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
<property name="toolTip">
<string>Click to view picture</string>
</property>
<property name="text">
<string>Image</string>
</property>
@ -129,6 +148,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ClickableLabel</class>
<extends>QLabel</extends>
<header>util/ClickableLabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -67,6 +67,12 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
@ -98,6 +104,12 @@
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>retweeted</string>
</property>
@ -137,21 +149,11 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_reply">
<property name="text">
@ -437,6 +439,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_authorName">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -444,6 +452,14 @@
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="font">
<font>
<family>Segoe UI</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;@sidler_here&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -470,6 +486,12 @@
</item>
<item>
<widget class="QLabel" name="label_date">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;· Apr 13 ·&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -586,11 +608,26 @@
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_reference">
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;Replying to @sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>

View File

@ -55,6 +55,12 @@
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="font">
<font>
<family>Segoe UI</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>WireGroupName</string>
</property>

View File

@ -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;
}