mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-17 01:24:15 -05:00
added expand button for board post items
This commit is contained in:
parent
c9c4b4c9d8
commit
68ee14e8c0
2 changed files with 55 additions and 21 deletions
|
|
@ -149,9 +149,9 @@ void BoardsPostItem::setup()
|
||||||
/* clear ui */
|
/* clear ui */
|
||||||
ui->titleLabel->setText(tr("Loading..."));
|
ui->titleLabel->setText(tr("Loading..."));
|
||||||
ui->datetimelabel->clear();
|
ui->datetimelabel->clear();
|
||||||
ui->filelabel->clear();
|
ui->filelabel->hide();
|
||||||
ui->newCommentLabel->clear();
|
ui->newCommentLabel->hide();
|
||||||
ui->commLabel->clear();
|
ui->commLabel->hide();
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(toggle()));
|
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(toggle()));
|
||||||
|
|
@ -329,6 +329,8 @@ void BoardsPostItem::fill()
|
||||||
|
|
||||||
//if( !IS_GROUP_PUBLISHER(mGroupMeta.mSubscribeFlags) )
|
//if( !IS_GROUP_PUBLISHER(mGroupMeta.mSubscribeFlags) )
|
||||||
ui->editButton->hide() ; // never show this button. Feeds are not the place to edit posts.
|
ui->editButton->hide() ; // never show this button. Feeds are not the place to edit posts.
|
||||||
|
|
||||||
|
if(mPost.mNotes.empty())
|
||||||
ui->expandButton->hide() ; // never show this button.
|
ui->expandButton->hide() ; // never show this button.
|
||||||
|
|
||||||
if (mCloseOnRead && !IS_MSG_NEW(mPost.mMeta.mMsgStatus)) {
|
if (mCloseOnRead && !IS_MSG_NEW(mPost.mMeta.mMsgStatus)) {
|
||||||
|
|
@ -353,8 +355,7 @@ void BoardsPostItem::fill()
|
||||||
|
|
||||||
std::cerr << "Copying 1 line from \"" << mPost.mNotes << "\"" << std::endl;
|
std::cerr << "Copying 1 line from \"" << mPost.mNotes << "\"" << std::endl;
|
||||||
//ui->newCommentLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mNotes.c_str()), 1)) ;
|
//ui->newCommentLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mNotes.c_str()), 1)) ;
|
||||||
ui->commLabel->hide();
|
//ui->newCommentLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), /* RSHTML_FORMATTEXT_EMBED_SMILEYS |*/ RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
ui->newCommentLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), /* RSHTML_FORMATTEXT_EMBED_SMILEYS |*/ RSHTML_FORMATTEXT_EMBED_LINKS));
|
|
||||||
|
|
||||||
if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
|
if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
|
||||||
{
|
{
|
||||||
|
|
@ -460,22 +461,10 @@ void BoardsPostItem::setReadStatus(bool isNew, bool isUnread)
|
||||||
ui->feedFrame->style()->polish( ui->feedFrame);
|
ui->feedFrame->style()->polish( ui->feedFrame);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TODO
|
|
||||||
void BoardsPostItem::expandFill(bool first)
|
|
||||||
{
|
|
||||||
GxsFeedItem::expandFill(first);
|
|
||||||
|
|
||||||
if (first) {
|
|
||||||
fillExpandFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BoardsPostItem::toggle()
|
void BoardsPostItem::toggle()
|
||||||
{
|
{
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*********** SPECIFIC FUNCTIONS ***********************/
|
/*********** SPECIFIC FUNCTIONS ***********************/
|
||||||
|
|
||||||
|
|
@ -498,3 +487,47 @@ void BoardsPostItem::readToggled(bool /*checked*/)
|
||||||
rsPosted->setPostReadStatus(msgPair, isUnread());
|
rsPosted->setPostReadStatus(msgPair, isUnread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BoardsPostItem::fillExpandFrame()
|
||||||
|
{
|
||||||
|
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), /* RSHTML_FORMATTEXT_EMBED_SMILEYS |*/ RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
}
|
||||||
|
|
||||||
|
void BoardsPostItem::doExpand(bool open)
|
||||||
|
{
|
||||||
|
if (mFeedHolder)
|
||||||
|
{
|
||||||
|
mFeedHolder->lockLayout(this, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (open)
|
||||||
|
{
|
||||||
|
ui->expandFrame->show();
|
||||||
|
ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png")));
|
||||||
|
ui->expandButton->setToolTip(tr("Hide"));
|
||||||
|
|
||||||
|
readToggled(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->expandFrame->hide();
|
||||||
|
ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png")));
|
||||||
|
ui->expandButton->setToolTip(tr("Expand"));
|
||||||
|
}
|
||||||
|
|
||||||
|
emit sizeChanged(this);
|
||||||
|
|
||||||
|
if (mFeedHolder)
|
||||||
|
{
|
||||||
|
mFeedHolder->lockLayout(this, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BoardsPostItem::expandFill(bool first)
|
||||||
|
{
|
||||||
|
GxsFeedItem::expandFill(first);
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ protected:
|
||||||
static uint64_t computeIdentifier(const RsGxsMessageId& msgid) { return hash64("BoardsPostItem " + msgid.toStdString()) ; }
|
static uint64_t computeIdentifier(const RsGxsMessageId& msgid) { return hash64("BoardsPostItem " + msgid.toStdString()) ; }
|
||||||
|
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open) override {}
|
virtual void doExpand(bool open) override ;
|
||||||
virtual void expandFill(bool first) override {}
|
virtual void expandFill(bool first) override ;
|
||||||
|
|
||||||
// This does nothing except triggering the loading of the post data and comments. This function is mainly used to detect
|
// This does nothing except triggering the loading of the post data and comments. This function is mainly used to detect
|
||||||
// when the post is actually made visible.
|
// when the post is actually made visible.
|
||||||
|
|
@ -75,7 +75,7 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
//void toggle() override;
|
void toggle() override;
|
||||||
void readAndClearItem();
|
void readAndClearItem();
|
||||||
void readToggled(bool checked);
|
void readToggled(bool checked);
|
||||||
void viewPicture();
|
void viewPicture();
|
||||||
|
|
@ -86,6 +86,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
void setup();
|
void setup();
|
||||||
void fill();
|
void fill();
|
||||||
|
void fillExpandFrame();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mCloseOnRead;
|
bool mCloseOnRead;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue