Added Notes button to view notes

This commit is contained in:
defnax 2019-02-04 23:59:31 +01:00
parent 4f3920a33a
commit 63d346f63d
5 changed files with 43 additions and 6 deletions

View File

@ -91,6 +91,7 @@ void PostedItem::setup()
ui->newCommentLabel->hide();
ui->frame_picture->hide();
ui->commLabel->hide();
ui->frame_notes->hide();
/* general ones */
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(removeItem()));
@ -102,6 +103,7 @@ void PostedItem::setup()
connect(ui->voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect(ui->voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT( toggle()));
connect(ui->notesButton, SIGNAL(clicked()), this, SLOT( toggleNotes()));
connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
@ -310,7 +312,7 @@ void PostedItem::fill()
// FIX THIS UP LATER.
ui->notes->setText(QString::fromUtf8(mPost.mNotes.c_str()));
if(ui->notes->text().isEmpty())
ui->frame_notes->hide();
ui->notesButton->hide();
// differences between Feed or Top of Comment.
if (mFeedHolder)
{
@ -528,3 +530,16 @@ void PostedItem::copyMessageLink()
RSLinkClipboard::copyLinks(urls);
}
}
void PostedItem::toggleNotes()
{
if (ui->notesButton->isChecked())
{
ui->frame_notes->show();
}
else
{
ui->frame_notes->hide();
}
}

View File

@ -61,6 +61,7 @@ private slots:
void readAndClearItem();
void toggle();
void copyMessageLink();
void toggleNotes();
signals:
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);

View File

@ -513,6 +513,26 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="notesButton">
<property name="text">
<string>Notes</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/notes.png</normaloff>:/images/notes.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -630,23 +650,23 @@
<item row="2" column="0">
<widget class="QFrame" name="frame_notes">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>1</number>
<number>3</number>
</property>
<property name="topMargin">
<number>1</number>
<number>3</number>
</property>
<property name="rightMargin">
<number>1</number>
<number>3</number>
</property>
<property name="bottomMargin">
<number>1</number>
<number>3</number>
</property>
<property name="spacing">
<number>1</number>

View File

@ -18,5 +18,6 @@
<file>images/comments.png</file>
<file>images/thumb-default.png</file>
<file>images/share.png</file>
<file>images/notes.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB