mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-21 12:03:43 -05:00
Add spacer if not modifying strValue and remove it otherwise
This commit is contained in:
parent
bd74629420
commit
1a07a93552
|
|
@ -163,7 +163,8 @@ MacroActionStreamEdit::MacroActionStreamEdit(
|
|||
_actions(new QComboBox()),
|
||||
_keyFrameInterval(new VariableSpinBox()),
|
||||
_stringValue(new VariableLineEdit(this)),
|
||||
_showPassword(new QPushButton())
|
||||
_showPassword(new QPushButton()),
|
||||
_layout(new QHBoxLayout())
|
||||
{
|
||||
_keyFrameInterval->setMinimum(0);
|
||||
_keyFrameInterval->setMaximum(25);
|
||||
|
|
@ -189,15 +190,13 @@ MacroActionStreamEdit::MacroActionStreamEdit(
|
|||
QWidget::connect(_showPassword, SIGNAL(released()), this,
|
||||
SLOT(HidePassword()));
|
||||
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.streaming.entry"),
|
||||
mainLayout,
|
||||
_layout,
|
||||
{{"{{actions}}", _actions},
|
||||
{"{{keyFrameInterval}}", _keyFrameInterval},
|
||||
{"{{stringValue}}", _stringValue},
|
||||
{"{{showPassword}}", _showPassword}},
|
||||
false);
|
||||
setLayout(mainLayout);
|
||||
{"{{showPassword}}", _showPassword}});
|
||||
setLayout(_layout);
|
||||
|
||||
_entryData = entryData;
|
||||
UpdateEntryData();
|
||||
|
|
@ -258,11 +257,18 @@ void MacroActionStreamEdit::SetWidgetVisiblity()
|
|||
const auto action = _entryData->_action;
|
||||
_keyFrameInterval->setVisible(
|
||||
action == MacroActionStream::Action::KEYFRAME_INTERVAL);
|
||||
_stringValue->setVisible(
|
||||
const bool modifyingStringValue =
|
||||
action == MacroActionStream::Action::SERVER ||
|
||||
action == MacroActionStream::Action::STREAM_KEY ||
|
||||
action == MacroActionStream::Action::USERNAME ||
|
||||
action == MacroActionStream::Action::PASSWORD);
|
||||
action == MacroActionStream::Action::PASSWORD;
|
||||
_stringValue->setVisible(modifyingStringValue);
|
||||
if (modifyingStringValue) {
|
||||
// Give as much space to string value line edit as posssible
|
||||
RemoveStretchIfPresent(_layout);
|
||||
} else {
|
||||
AddStretchIfNecessary(_layout);
|
||||
}
|
||||
if (action == MacroActionStream::Action::PASSWORD ||
|
||||
action == MacroActionStream::Action::STREAM_KEY) {
|
||||
_stringValue->setEchoMode(QLineEdit::PasswordEchoOnEdit);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ protected:
|
|||
private:
|
||||
void SetWidgetVisiblity();
|
||||
|
||||
QHBoxLayout *_mainLayout;
|
||||
QHBoxLayout *_layout;
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user