Show save image option only when it is needed

This commit is contained in:
hunbernd 2015-12-12 22:41:15 +01:00
parent bbebd6a5d7
commit bc4691ceb4
4 changed files with 21 additions and 4 deletions

View file

@ -979,8 +979,12 @@ void ChatWidget::contextMenuTextBrowser(QPoint point)
contextMnu->addAction(ui->actionClearChatHistory);
contextMnu->addAction(ui->actionQuote);
ui->actionSave_image->setData(point);
contextMnu->addAction(ui->actionSave_image);
QTextCursor cursor = ui->textBrowser->cursorForPosition(point);
if(ImageUtil::checkImage(cursor))
{
ui->actionSave_image->setData(point);
contextMnu->addAction(ui->actionSave_image);
}
contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point));
delete(contextMnu);