mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improved animation control
Fixed double redraw related to update of the time step in the combo box called during use of the animation toolbar p4#: 22098
This commit is contained in:
@@ -172,7 +172,7 @@ void AnimationToolBar::connectAnimationControl(caf::FrameAnimationControl* anima
|
|||||||
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), animationControl, SLOT(setCurrentFrame(int)));
|
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), animationControl, SLOT(setCurrentFrame(int)));
|
||||||
connect(m_frameRateSlider, SIGNAL(valueChanged(int)), this, SLOT(slotFrameRateSliderChanged(int)));
|
connect(m_frameRateSlider, SIGNAL(valueChanged(int)), this, SLOT(slotFrameRateSliderChanged(int)));
|
||||||
|
|
||||||
connect(animationControl, SIGNAL(changeFrame(int)), m_timestepCombo, SLOT(setCurrentIndex (int)));
|
connect(animationControl, SIGNAL(changeFrame(int)), SLOT(slotUpdateComboBoxIndex(int)));
|
||||||
connect(animationControl, SIGNAL(frameCountChanged(int)), this, SLOT(slotUpdateTimestepList(int)));
|
connect(animationControl, SIGNAL(frameCountChanged(int)), this, SLOT(slotUpdateTimestepList(int)));
|
||||||
int timeout = animationControl->timeout();
|
int timeout = animationControl->timeout();
|
||||||
double initialFrameRate = 1000;
|
double initialFrameRate = 1000;
|
||||||
@@ -318,4 +318,17 @@ void AnimationToolBar::slotFwdBwdModeToggled(bool on)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void AnimationToolBar::slotUpdateComboBoxIndex(int value)
|
||||||
|
{
|
||||||
|
// Update only the combo box index, but do not set current frame
|
||||||
|
// Disconnect the signal temporarily when updating UI
|
||||||
|
|
||||||
|
disconnect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), m_activeAnimationControl, SLOT(setCurrentFrame(int)));
|
||||||
|
m_timestepCombo->setCurrentIndex(value);
|
||||||
|
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), m_activeAnimationControl, SLOT(setCurrentFrame(int)));
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace caf
|
} // End namespace caf
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ private slots:
|
|||||||
void slotFrameRateSliderChanged(int value);
|
void slotFrameRateSliderChanged(int value);
|
||||||
void slotFromStartModeToggled(bool on);
|
void slotFromStartModeToggled(bool on);
|
||||||
void slotFwdBwdModeToggled(bool on);
|
void slotFwdBwdModeToggled(bool on);
|
||||||
|
void slotUpdateComboBoxIndex(int value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|||||||
Reference in New Issue
Block a user