mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -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:
parent
3f61c26f0b
commit
adff387d36
@ -172,7 +172,7 @@ void AnimationToolBar::connectAnimationControl(caf::FrameAnimationControl* anima
|
||||
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), animationControl, SLOT(setCurrentFrame(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)));
|
||||
int timeout = animationControl->timeout();
|
||||
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
|
||||
|
@ -60,6 +60,7 @@ private slots:
|
||||
void slotFrameRateSliderChanged(int value);
|
||||
void slotFromStartModeToggled(bool on);
|
||||
void slotFwdBwdModeToggled(bool on);
|
||||
void slotUpdateComboBoxIndex(int value);
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
Loading…
Reference in New Issue
Block a user