From 612eba1b1a650d62069e627ee6c7daefecc953b2 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 1 Feb 2021 19:40:33 -0600 Subject: [PATCH] Fix Surface task panel shortcut use to use Widget context The Delete key shortcut of the three different panels in the Surface Workbench TaskFilling sidebar conflicted between the panels if multiple were showing. This is resolved by making the QAction's context the widget, rather than the window. --- src/Mod/Surface/Gui/TaskFilling.cpp | 1 + src/Mod/Surface/Gui/TaskFillingEdge.cpp | 1 + src/Mod/Surface/Gui/TaskFillingVertex.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Mod/Surface/Gui/TaskFilling.cpp b/src/Mod/Surface/Gui/TaskFilling.cpp index e9ec391cef..30b7f00a8b 100644 --- a/src/Mod/Surface/Gui/TaskFilling.cpp +++ b/src/Mod/Surface/Gui/TaskFilling.cpp @@ -272,6 +272,7 @@ FillingPanel::FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj) // Create context menu QAction* action = new QAction(tr("Remove"), this); action->setShortcut(QString::fromLatin1("Del")); + action->setShortcutContext(Qt::WidgetShortcut); ui->listBoundary->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(onDeleteEdge())); ui->listBoundary->setContextMenuPolicy(Qt::ActionsContextMenu); diff --git a/src/Mod/Surface/Gui/TaskFillingEdge.cpp b/src/Mod/Surface/Gui/TaskFillingEdge.cpp index 7ea642fbf4..f0bb1f71d2 100644 --- a/src/Mod/Surface/Gui/TaskFillingEdge.cpp +++ b/src/Mod/Surface/Gui/TaskFillingEdge.cpp @@ -128,6 +128,7 @@ FillingEdgePanel::FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* ob // Create context menu QAction* action = new QAction(tr("Remove"), this); action->setShortcut(QString::fromLatin1("Del")); + action->setShortcutContext(Qt::WidgetShortcut); ui->listUnbound->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(onDeleteUnboundEdge())); ui->listUnbound->setContextMenuPolicy(Qt::ActionsContextMenu); diff --git a/src/Mod/Surface/Gui/TaskFillingVertex.cpp b/src/Mod/Surface/Gui/TaskFillingVertex.cpp index b39d0fd334..4bfa3a6be6 100644 --- a/src/Mod/Surface/Gui/TaskFillingVertex.cpp +++ b/src/Mod/Surface/Gui/TaskFillingVertex.cpp @@ -127,6 +127,7 @@ FillingVertexPanel::FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling // Create context menu QAction* action = new QAction(tr("Remove"), this); action->setShortcut(QString::fromLatin1("Del")); + action->setShortcutContext(Qt::WidgetShortcut); ui->listFreeVertex->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(onDeleteVertex())); ui->listFreeVertex->setContextMenuPolicy(Qt::ActionsContextMenu);