improved layout of board post item

This commit is contained in:
csoler 2025-11-18 22:01:12 +01:00
parent 68ee14e8c0
commit a94c85751e
2 changed files with 49 additions and 210 deletions

View file

@ -130,14 +130,14 @@ void BoardsPostItem::setup()
ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default-video.png"));
//ui->warn_image_label->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/status_unknown.png"));
ui->readButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png"));
ui->voteUpButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_up.png"));
ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png"));
ui->downloadButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/download.png"));
ui->playButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/play.png"));
//ui->readButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png"));
//ui->voteUpButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_up.png"));
//ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png"));
//ui->downloadButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/download.png"));
//ui->playButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/play.png"));
ui->commentButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
//ui->editButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/pencil-edit-button.png"));
ui->copyLinkButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/copy.png"));
//ui->copyLinkButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/copy.png"));
ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/down-arrow.png"));
ui->readAndClearButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/correct.png"));
ui->clearButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/exit2.png"));
@ -149,9 +149,9 @@ void BoardsPostItem::setup()
/* clear ui */
ui->titleLabel->setText(tr("Loading..."));
ui->datetimelabel->clear();
ui->filelabel->hide();
ui->newCommentLabel->hide();
ui->commLabel->hide();
//ui->filelabel->hide();
//ui->newCommentLabel->hide();
//ui->commLabel->hide();
/* general ones */
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(toggle()));
@ -160,30 +160,30 @@ void BoardsPostItem::setup()
/* specific */
connect(ui->readAndClearButton, SIGNAL(clicked()), this, SLOT(readAndClearItem()));
connect(ui->unsubscribeButton, SIGNAL(clicked()), this, SLOT(unsubscribeChannel()));
//connect(ui->unsubscribeButton, SIGNAL(clicked()), this, SLOT(unsubscribeChannel()));
connect(ui->downloadButton, SIGNAL(clicked()), this, SLOT(download()));
//connect(ui->downloadButton, SIGNAL(clicked()), this, SLOT(download()));
// HACK FOR NOW.
ui->commentButton->hide();// hidden until properly enabled.
// connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments()));
connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play(void)));
//connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play(void)));
//connect(ui->editButton, SIGNAL(clicked()), this, SLOT(edit(void)));
connect(ui->copyLinkButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
//connect(ui->copyLinkButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
//connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
// hide voting buttons, backend is not implemented yet
ui->voteUpButton->hide();
ui->voteDownButton->hide();
//ui->voteUpButton->hide();
//ui->voteDownButton->hide();
ui->scoreLabel->hide();
//ui->scoreLabel->hide();
// hide unsubscribe button not necessary
ui->unsubscribeButton->hide();
//ui->unsubscribeButton->hide();
ui->downloadButton->hide();
ui->playButton->hide();
//ui->downloadButton->hide();
//ui->playButton->hide();
//ui->warn_image_label->hide();
//ui->warning_label->hide();
@ -328,7 +328,7 @@ void BoardsPostItem::fill()
ui->logoLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default-video.png") );
//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.
@ -357,17 +357,17 @@ void BoardsPostItem::fill()
//ui->newCommentLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mNotes.c_str()), 1)) ;
//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))
{
ui->unsubscribeButton->setEnabled(true);
}
else
{
ui->unsubscribeButton->setEnabled(false);
}
ui->readButton->hide();
// if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
// {
// ui->unsubscribeButton->setEnabled(true);
// }
// else
// {
// ui->unsubscribeButton->setEnabled(false);
// }
//ui->readButton->hide();
ui->newLabel->hide();
ui->copyLinkButton->hide();
//ui->copyLinkButton->hide();
if (IS_MSG_NEW(mPost.mMeta.mMsgStatus))
mCloseOnRead = true;

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1092</width>
<height>255</height>
<width>803</width>
<height>175</height>
</rect>
</property>
<layout class="QGridLayout" name="BoardsPostItem_GL">
@ -138,190 +138,26 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="subjectLabel">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="newCommHLayout">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="newCommentLabel">
<property name="text">
<string>New Comment:</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ElidedLabel" name="commLabel">
<property name="text">
<string>Comment Value</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="buttonHLayout">
<property name="spacing">
<number>8</number>
</property>
<item>
<widget class="QPushButton" name="readButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Toggle Message Read Status</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scoreLabel">
<widget class="QLabel" name="subjectLabel">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="voteUpButton">
<property name="toolTip">
<string>I like this</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="voteDownButton">
<property name="toolTip">
<string>I dislike this</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="downloadButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Download</string>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="playButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Play</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="copyLinkButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Copy RetroShare Link</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="filelabel">
<property name="text">
<string notr="true">fileLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="unsubscribeButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Unsubscribe From Channel</string>
</property>
<property name="text">
<string>Unsubscribe</string>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
@ -338,6 +174,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">
@ -478,18 +321,14 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/ElidedLabel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ZoomableLabel</class>
<extends>QLabel</extends>
<header>gui/gxschannels/GxsChannelPostThumbnail.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../icons.qrc"/>
</resources>
<connections/>
</ui>