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

Method LanguageSelectionWidget

plugins/twitch/language-selection.cpp:217–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217LanguageSelectionWidget::LanguageSelectionWidget(QWidget *parent)
218 : QWidget(parent),
219 _languageText(new VariableLineEdit(this)),
220 _languageCombo(new QComboBox(this)),
221 _toggleInput(new QPushButton(this))
222{
223 populateLocaleSelection(_languageCombo);
224
225 auto getCurrent = new QPushButton(obs_module_text(
226 "AdvSceneSwitcher.action.twitch.language.getCurrent"));
227 connect(getCurrent, &QPushButton::clicked, this,
228 &LanguageSelectionWidget::GetCurrentClicked);
229
230 _toggleInput->setCheckable(true);
231 _toggleInput->setMaximumWidth(11);
232 SetButtonIcon(_toggleInput, GetThemeTypeName() == "Light"
233 ? ":/res/images/dots-vert.svg"
234 : "theme:Dark/dots-vert.svg");
235
236 connect(_toggleInput, &QPushButton::toggled, this, [this]() {
237 _languageText->setVisible(!_languageText->isVisible());
238 _languageCombo->setVisible(!_languageCombo->isVisible());
239 });
240
241 connect(_languageText, &VariableLineEdit::editingFinished, this,
242 &LanguageSelectionWidget::TextChanged);
243 connect(_languageCombo, &QComboBox::currentIndexChanged, this,
244 &LanguageSelectionWidget::ComboSelectionChanged);
245
246 auto inputLayout = new QHBoxLayout;
247 inputLayout->addWidget(_languageCombo);
248 inputLayout->addWidget(_languageText);
249 inputLayout->addWidget(_toggleInput);
250
251 auto layout = new QVBoxLayout;
252 layout->addLayout(inputLayout);
253 layout->addWidget(getCurrent);
254 setLayout(layout);
255}
256
257void LanguageSelectionWidget::SetLanguageSelection(
258 const LanguageSelection &language)

Callers

nothing calls this directly

Calls 4

populateLocaleSelectionFunction · 0.85
obs_module_textFunction · 0.85
SetButtonIconFunction · 0.50
GetThemeTypeNameFunction · 0.50

Tested by

no test coverage detected