Skip to content

Commit

Permalink
further simplify if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder committed Jan 12, 2025
1 parent 59a4ca1 commit 5ee7cba
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/pdfviewer/PDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,14 +1589,10 @@ void PDFWidget::contextMenuEvent(QContextMenuEvent *event)
usingTool = kNone;
}

if (pdfDoc && pdfDoc->menuShow) {
if (pdfDoc && pdfDoc->menuShow && pdfDoc->menuGrid) {
menu.addSeparator();
if (pdfDoc->menuGrid) {
menu.addMenu(pdfDoc->menuGrid);
}
if (pdfDoc->menuShow) {
menu.addMenu(pdfDoc->menuShow);
}
menu.addMenu(pdfDoc->menuGrid);
menu.addMenu(pdfDoc->menuShow);
}

QAction *action = menu.exec(event->globalPos());
Expand Down

0 comments on commit 5ee7cba

Please sign in to comment.