mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Remove layout spacer if text input is required
This commit is contained in:
parent
50c54a8341
commit
498bf31295
|
|
@ -507,7 +507,8 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
_scenes(new SceneSelectionWidget(this, true, false, true, true,
|
||||
true)),
|
||||
_tempVars(new TempVariableSelection(this)),
|
||||
_sceneItemIndex(new VariableSpinBox())
|
||||
_sceneItemIndex(new VariableSpinBox()),
|
||||
_entryLayout(new QHBoxLayout())
|
||||
{
|
||||
_numValue->setMinimum(-9999999999);
|
||||
_numValue->setMaximum(9999999999);
|
||||
|
|
@ -602,9 +603,8 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
{"{{tempVars}}", _tempVars},
|
||||
{"{{sceneItemIndex}}", _sceneItemIndex},
|
||||
};
|
||||
auto entryLayout = new QHBoxLayout;
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.variable.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
_entryLayout, widgetPlaceholders);
|
||||
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
|
|
@ -640,7 +640,7 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
_substringLayout->addLayout(regexConfigLayout);
|
||||
|
||||
auto layout = new QVBoxLayout;
|
||||
layout->addLayout(entryLayout);
|
||||
layout->addLayout(_entryLayout);
|
||||
layout->addLayout(_substringLayout);
|
||||
layout->addWidget(_segmentValueStatus);
|
||||
layout->addWidget(_segmentValue);
|
||||
|
|
@ -1059,6 +1059,17 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
return;
|
||||
}
|
||||
|
||||
if (_entryData->_type == MacroActionVariable::Type::SET_FIXED_VALUE ||
|
||||
_entryData->_type == MacroActionVariable::Type::APPEND ||
|
||||
_entryData->_type == MacroActionVariable::Type::MATH_EXPRESSION ||
|
||||
_entryData->_type == MacroActionVariable::Type::ENV_VARIABLE ||
|
||||
_entryData->_type == MacroActionVariable::Type::STRING_LENGTH ||
|
||||
_entryData->_type == MacroActionVariable::Type::EXTRACT_JSON) {
|
||||
RemoveStretchIfPresent(_entryLayout);
|
||||
} else {
|
||||
AddStretchIfNecessary(_entryLayout);
|
||||
}
|
||||
|
||||
_variables2->setVisible(_entryData->_type ==
|
||||
MacroActionVariable::Type::APPEND_VAR);
|
||||
_strValue->setVisible(
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ private:
|
|||
SceneSelectionWidget *_scenes;
|
||||
TempVariableSelection *_tempVars;
|
||||
VariableSpinBox *_sceneItemIndex;
|
||||
QHBoxLayout *_entryLayout;
|
||||
|
||||
std::shared_ptr<MacroActionVariable> _entryData;
|
||||
QTimer _timer;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user