Skip to content

Commit

Permalink
Re #12616. Resizing new view makes it work.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Sep 14, 2015
1 parent 00f89a1 commit a7aa562
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -1081,6 +1081,7 @@ void MdViewerWidget::switchViews(ModeControlWidget::Views v)
this->hiddenView = this->createAndSetMainViewWidget(this->ui.viewWidget, v);
this->ui.colorSelectionWidget->ignoreColorChangeCallbacks(true);
this->hiddenView->setColorScaleState(this->ui.colorSelectionWidget);
auto viewSize = this->hiddenView->size();
this->hiddenView->hide();
this->viewLayout->removeWidget(this->currentView);

Expand Down Expand Up @@ -1118,6 +1119,10 @@ void MdViewerWidget::switchViews(ModeControlWidget::Views v)
this->setDestroyedListener();
this->currentView->setVisibilityListener();

// A workaround to make the view redraw itself properly
// after switching from a resized view
this->currentView->resize(viewSize);

// ignore callbacks until as late as possible to keep desired state
// regardless of what the Paraview widgets are doing
this->ui.colorSelectionWidget->ignoreColorChangeCallbacks(false);
Expand Down

0 comments on commit a7aa562

Please sign in to comment.