mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Add context menu to empty plot window area (#14243)
* Add context menu to empty plot window area Improve drag'n'drop into empty plot window area
This commit is contained in:
7 files changed
+100
-1
No files matched your search
@@ -971,7 +971,12 @@ void RiuPlotMainWindow::dragEnterEvent( QDragEnterEvent* event )
|
||||
if ( m_centralDockWidget != nullptr )
|
||||
{
|
||||
QPoint curpos = m_centralDockWidget->mapFromGlobal( QCursor::pos() );
|
||||
if ( m_centralDockWidget->rect().contains( curpos ) ) event->acceptProposedAction();
|
||||
auto rect = m_centralDockWidget->widget()->rect();
|
||||
rect.adjust( -10, -10, 10, 10 ); // allow some tolerance outside the widget
|
||||
if ( rect.contains( curpos ) )
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1106,3 +1111,14 @@ void RiuPlotMainWindow::slotViewFullScreen( bool showFullScreen )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::onCentralWidgetContextMenu( QMenu& menu )
|
||||
{
|
||||
QStringList commandIds;
|
||||
commandIds << "RicNewEmptySummaryMultiPlotFeature";
|
||||
commandIds << "RicOpenSummaryPlotEditorFromDockAreaFeature";
|
||||
caf::CmdFeatureMenuBuilder::appendToMenu( &menu, commandIds );
|
||||
}
|
||||
Reference in new issue
Block a user