Prevent passing the focus to a spinbox when it shouldn't.

In some DSH some mode (seekSecond for example) don't have onViewParameter. In this case it would wrongly try to give focus to the previous spinbox with focus.
This commit is contained in:
Paddle
2023-11-03 18:19:49 +01:00
committed by abdullahtahiriyo
parent 336691cd5a
commit aa4a158e0c

View File

@@ -406,7 +406,9 @@ protected:
virtual void afterEnforceControlParameters()
{
// Give focus to current on-view parameter. In case user interacted outside of 3dview.
setFocusToOnViewParameter(onViewIndexWithFocus);
if (onViewIndexWithFocus >= 0) {
setFocusToOnViewParameter(onViewIndexWithFocus);
}
}
virtual void doConstructionMethodChanged()
@@ -489,6 +491,8 @@ protected:
void setModeOnViewParameters()
{
bool firstOfMode = true;
onViewIndexWithFocus = -1;
for (size_t i = 0; i < onViewParameters.size(); i++) {
if (!isOnViewParameterOfCurrentMode(i)) {
onViewParameters[i]->stopEdit();