@@ -246,8 +246,11 @@ void ScatterplotPlugin::init()
246246 layout->addWidget (_primaryToolbarAction.createWidget (&getWidget ()));
247247 layout->addWidget (_scatterPlotWidget, 100 );
248248
249+ auto navigationWidget = new QWidget ();
249250 auto navigationLayout = new QHBoxLayout ();
250251
252+ navigationLayout->setContentsMargins (4 , 4 , 4 , 4 );
253+
251254 navigationLayout->addStretch (1 );
252255 {
253256 auto renderersNavigationGroupAction = new HorizontalGroupAction (this , " Renderers Navigation" );
@@ -261,11 +264,12 @@ void ScatterplotPlugin::init()
261264 }
262265 navigationLayout->addStretch (1 );
263266
264- layout->addLayout (navigationLayout);
267+ navigationWidget->setLayout (navigationLayout);
268+
269+ layout->addWidget (navigationWidget);
265270
266271 getWidget ().setLayout (layout);
267272
268- // Update the data when the scatter plot widget is initialized
269273 connect (_scatterPlotWidget, &ScatterplotWidget::initialized, this , &ScatterplotPlugin::updateData);
270274
271275 connect (&_scatterPlotWidget->getPixelSelectionTool (), &PixelSelectionTool::areaChanged, [this ]() {
@@ -463,6 +467,8 @@ void ScatterplotPlugin::selectPoints()
463467 }
464468 }
465469
470+ _scatterPlotWidget->getPointRendererNavigator ().getNavigationAction ().getZoomSelectionAction ().setEnabled (!targetSelectionIndices.empty ());
471+
466472 _positionDataset->setSelectionIndices (targetSelectionIndices);
467473
468474 events ().notifyDatasetDataSelectionChanged (_positionDataset->getSourceDataset <Points>());
@@ -597,7 +603,10 @@ void ScatterplotPlugin::positionDatasetChanged()
597603 _positionSourceDataset = _positionDataset->getSourceDataset <Points>();
598604
599605 _numPoints = _positionDataset->getNumPoints ();
600-
606+
607+ _scatterPlotWidget->getPointRendererNavigator ().resetView (true );
608+ _scatterPlotWidget->getDensityRendererNavigator ().resetView (true );
609+
601610 updateData ();
602611}
603612
0 commit comments