Gui: add function View3DSettings::stopAnimatingIfDeactivated()

This commit is contained in:
wmayer
2023-02-26 16:14:44 +01:00
committed by wwmayer
parent 9d5ab79a4c
commit bb1de399ad
3 changed files with 8 additions and 2 deletions

View File

@@ -638,8 +638,7 @@ void View3DInventor::windowStateChanged(MDIView* view)
}
if (canStartTimer) {
// do a single shot event (maybe insert a checkbox in viewer settings)
int msecs = 3000; //hGrp->GetInt("stopAnimatingIfDeactivated", 3000);
int msecs = viewSettings->stopAnimatingIfDeactivated();
if (!stopSpinTimer->isActive() && msecs >= 0) { // if < 0 do not stop rotation
stopSpinTimer->setSingleShot(true);
stopSpinTimer->start(msecs);

View File

@@ -53,6 +53,12 @@ View3DSettings::~View3DSettings()
hGrp->Detach(this);
}
int View3DSettings::stopAnimatingIfDeactivated() const
{
long defaultTimeout = 3000;
return hGrp->GetInt("stopAnimatingIfDeactivated", defaultTimeout);
}
void View3DSettings::applySettings()
{
// apply the user settings

View File

@@ -37,6 +37,7 @@ public:
/// Observer message from the ParameterGrp
void OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::MessageType Reason) override;
void applySettings();
int stopAnimatingIfDeactivated() const;
private:
ParameterGrp::handle hGrp;