Commit b8a12cd6 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 5b185ac7
......@@ -107,7 +107,6 @@ void ArticleViewerWebEngine::slotWebPageMutedOrAudibleChanged()
#endif
}
QWebEngineView *ArticleViewerWebEngine::createWindow(QWebEnginePage::WebWindowType type)
{
qDebug() << " QWebEngineView *ArticleViewerWebEngine::createWindow(QWebEnginePage::WebWindowType type) not implemented yet" << type;
......
......@@ -149,21 +149,22 @@ void TabWidget::slotTabContextMenuRequest(const QPoint &pos)
}
QMenu menu(this);
const int countTab = (count() > 1);
QAction *detachTab = menu.addAction(i18nc("@action:inmenu", "Detach Tab"));
detachTab->setEnabled((indexBar != 0) && (count() > 1));
detachTab->setEnabled((indexBar != 0) && countTab);
detachTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-detach")));
menu.addSeparator();
QAction *closeTab = menu.addAction(i18nc("@action:inmenu", "Close Tab"));
closeTab->setEnabled((indexBar != 0) && (count() > 1));
closeTab->setEnabled((indexBar != 0) && countTab);
closeTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
QAction *allOther = menu.addAction(i18nc("@action:inmenu", "Close All Other Tabs"));
allOther->setEnabled(count() > 1);
allOther->setEnabled(countTab);
allOther->setIcon(QIcon::fromTheme(QStringLiteral("tab-close-other")));
QAction *allTab = menu.addAction(i18nc("@action:inmenu", "Close All Tabs"));
allTab->setEnabled(count() > 1);
allTab->setEnabled(countTab);
allTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
QAction *action = menu.exec(mapToGlobal(pos));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment