From d375140b2e760226ff5f0d8aafc0386c0010644b Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Thu, 25 May 2017 14:30:46 +0200 Subject: [PATCH] Disable context menus that could lead to users removing UI parts If a user removes the main toolbar then there's no way to get it back. We don't want that. If a user removes a dock window's contents he can get it back by using the same context menu but it's a useless feature for us and potentially very confusing, so we disable this, too. --- pv/mainwindow.cpp | 1 + pv/toolbars/mainbar.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 205c95ca..86a01553 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -188,6 +188,7 @@ shared_ptr MainWindow::add_view(const QString &title, dock_main->setCentralWidget(v.get()); dock->setWidget(dock_main); + dock->setContextMenuPolicy(Qt::PreventContextMenu); dock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 0f92f060..4f5cd158 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -114,6 +114,8 @@ MainBar::MainBar(Session &session, QWidget *parent, { setObjectName(QString::fromUtf8("MainBar")); + setContextMenuPolicy(Qt::PreventContextMenu); + // Actions action_new_view_->setText(tr("New &View")); action_new_view_->setIcon(QIcon::fromTheme("window-new", -- 2.30.2