fixed regression in slider

The recent slider focus addition caused the label to re-focus if the user
pressed enter in the line edit, causing the line edit to never disappear.
This commit is contained in:
itsmattkc
2019-12-16 03:00:26 +11:00
parent 3f79845464
commit 4ddeadaf46
+4
View File
@@ -233,6 +233,7 @@ void SliderBase::LineEditConfirmed()
// Ensure editor doesn't signal that the focus is lost
editor_->blockSignals(true);
label_->blockSignals(true);
if (is_valid) {
SetValue(test_val);
@@ -251,15 +252,18 @@ void SliderBase::LineEditConfirmed()
}
editor_->blockSignals(false);
label_->blockSignals(false);
}
void SliderBase::LineEditCancelled()
{
// Ensure editor doesn't signal that the focus is lost
editor_->blockSignals(true);
label_->blockSignals(true);
// Set widget back to label
setCurrentWidget(label_);
editor_->blockSignals(false);
label_->blockSignals(false);
}