Gui: add function View3DSettings::stopAnimatingIfDeactivated()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user