Merge pull request #24 from defnax/boards-fix

Boards fixes
This commit is contained in:
csoler 2020-10-07 23:09:08 +02:00 committed by GitHub
commit ac6b14540a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 41 additions and 10 deletions

View File

@ -186,7 +186,7 @@ void BoardPostDisplayWidgetBase::setup()
QObject::connect(readButton(), SIGNAL(clicked()), this, SLOT(readToggled()));
QAction *CopyLinkAction = new QAction(QIcon(""),tr("Copy RetroShare Link"), this);
connect(CopyLinkAction, SIGNAL(triggered()), this, SLOT(copyMessageLink()));
connect(CopyLinkAction, SIGNAL(triggered()), this, SLOT(handleCopyLinkClicked()));
QAction *showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this);
connect(showInPeopleAct, SIGNAL(triggered()), this, SLOT(showAuthorInPeople()));
@ -217,6 +217,7 @@ void BoardPostDisplayWidgetBase::setup()
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
dateLabel()->setText(timestamp);
pictureLabel()->setDisabled(true);
}
else
{
@ -311,6 +312,11 @@ void BoardPostDisplayWidgetBase::handleShareButtonClicked()
{
emit shareButtonClicked();
}
void BoardPostDisplayWidgetBase::handleCopyLinkClicked()
{
emit copylinkClicked();
}
//===================================================================================================================================
//== class BoardPostDisplayWidget ==
//===================================================================================================================================
@ -348,15 +354,15 @@ void BoardPostDisplayWidget_compact::setup()
RsReputationLevel overall_reputation = rsReputations->overallReputationLevel(mPost.mMeta.mAuthorId);
bool redacted = (overall_reputation == RsReputationLevel::LOCALLY_NEGATIVE);
if(redacted)
{
ui->pictureLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png") );
}
else
{
int desired_height = QFontMetricsF(font()).height() * 5;
ui->pictureLabel->setFixedSize(16/9.0*desired_height,desired_height);
if(redacted)
{
ui->pictureLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-blocked.png") );
}
else
{
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;

View File

@ -90,6 +90,8 @@ protected slots:
void makeDownVote() ;
void setCommentsSize(int comNb) ;
void handleShareButtonClicked() ;
void handleCopyLinkClicked() ;
signals:
void changeReadStatusRequested(const RsGxsMessageId&,bool);
@ -98,6 +100,7 @@ signals:
void commentsRequested(const RsGxsMessageId&,bool);
void thumbnailOpenned();
void shareButtonClicked();
void copylinkClicked();
protected:
RsPostedPost mPost;

View File

@ -183,6 +183,9 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>3</number>
</property>
<item>
<widget class="StyledLabel" name="titleLabel">
<property name="sizePolicy">
@ -219,10 +222,13 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>5</number>
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>

View File

@ -205,6 +205,7 @@ QWidget *PostedPostDelegate::createEditor(QWidget *parent, const QStyleOptionVie
QObject::connect(w,SIGNAL(expand(RsGxsMessageId,bool)),this,SLOT(markCurrentPostAsRead()));
QObject::connect(w,SIGNAL(commentsRequested(const RsGxsMessageId&,bool)),mPostListWidget,SLOT(markCurrentPostAsRead()));
QObject::connect(w,SIGNAL(shareButtonClicked()),mPostListWidget,SLOT(markCurrentPostAsRead()));
QObject::connect(w,SIGNAL(copylinkClicked()),mPostListWidget,SLOT(copyMessageLink()));
w->setFixedSize(option.rect.size());
w->adjustSize();
@ -405,6 +406,7 @@ void PostedListWidgetWithModel::copyMessageLink()
QList<RetroShareLink> urls;
urls.push_back(link);
RSLinkClipboard::copyLinks(urls);
QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ;
}
catch(std::exception& e)
{

View File

@ -6,6 +6,7 @@
<file>images/up-arrow.png</file>
<file>images/comments.png</file>
<file>images/comments_blue.png</file>
<file>images/thumb-blocked.png</file>
<file>images/thumb-default.png</file>
<file>images/thumb-link.png</file>
<file>images/share.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -7,11 +7,11 @@
<x>0</x>
<y>0</y>
<width>632</width>
<height>547</height>
<height>248</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -23,7 +23,7 @@
<item row="1" column="0">
<widget class="GxsCommentTreeWidget" name="treeWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>

View File

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

View File

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