MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetupWidgets

Method SetupWidgets

lib/macro/macro-input.cpp:196–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194void HighlightMacroSettingsButton(bool enable);
195
196void MacroInputEdit::SetupWidgets()
197{
198 ClearLayout(_layout);
199
200 auto &vars = _variables._inputVariables;
201 if (vars.empty()) {
202 _layout->addWidget(new QLabel(obs_module_text(
203 "AdvSceneSwitcher.macroTab.inputSettings.noInputs")));
204 adjustSize();
205 updateGeometry();
206 return;
207 }
208
209 for (size_t index = 0; index < vars.size(); index++) {
210 auto variable = vars.at(index).lock();
211 QLabel *label = new QLabel(
212 variable
213 ? QString::fromStdString(variable->Name())
214 : obs_module_text(
215 "AdvSceneSwitcher.macroTab.inputSettings.invalid"));
216 _layout->addWidget(label, index, 0);
217 auto valueEdit = new VariableLineEdit(this);
218 valueEdit->setEnabled(!!variable);
219 valueEdit->setText(_values.at(index));
220 connect(valueEdit, &VariableLineEdit::editingFinished,
221 [this, valueEdit, index]() {
222 _values[index] =
223 valueEdit->text().toStdString();
224 emit MacroInputValuesChanged(_values);
225 });
226 _layout->addWidget(valueEdit, index, 1);
227 }
228
229 adjustSize();
230 updateGeometry();
231}
232
233} // namespace advss

Callers 1

Calls 6

ClearLayoutFunction · 0.85
obs_module_textFunction · 0.85
sizeMethod · 0.80
setTextMethod · 0.80
emptyMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected