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