mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-20 19:41:18 -05:00
Only change text of segment value preview if value changed
This is done to prevent the selection being lost whenever the text filed was updated.
This commit is contained in:
parent
a83d2d9910
commit
37ba7aa2ca
|
|
@ -750,8 +750,14 @@ void MacroActionVariableEdit::UpdateSegmentVariableValue()
|
|||
_segmentValueStatus->setText(obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.currentSegmentValue"));
|
||||
_segmentValue->show();
|
||||
_segmentValue->setPlainText(
|
||||
QString::fromStdString(segment->GetVariableValue()));
|
||||
|
||||
// Only update the text if the value changed to prevent possible text
|
||||
// selections being lost
|
||||
auto previousText = _segmentValue->toPlainText();
|
||||
auto newText = QString::fromStdString(segment->GetVariableValue());
|
||||
if (newText != previousText) {
|
||||
_segmentValue->setPlainText(newText);
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user