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.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user