Spoiler feature

Select text to hide, then right click --> Spoiler
This commit is contained in:
hunbernd 2015-12-07 02:28:27 +01:00
parent cdda411c79
commit 5a8f74ce99
4 changed files with 51 additions and 0 deletions

View file

@ -231,6 +231,8 @@ void MimeTextEdit::contextMenuEvent(QContextMenuEvent *e)
/* Add actions for pasting links */
contextMenu->addAction( tr("Paste as plain text"), this, SLOT(pastePlainText()));
QAction *spoilerAction = contextMenu->addAction(tr("Spoiler"), this, SLOT(spoiler()));
spoilerAction->setToolTip(tr("Select text to hide, then push this button"));
contextMenu->addSeparator();
QAction *pasteLinkAction = contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste my certificate link"), this, SLOT(pasteOwnCertificateLink()));
@ -268,3 +270,8 @@ void MimeTextEdit::pastePlainText()
{
insertPlainText(QApplication::clipboard()->text());
}
void MimeTextEdit::spoiler()
{
RsHtml::insertSpoilerText(this->textCursor());
}