mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-30 05:06:14 -05:00
Double click on list item in run and sequence action to edit
This commit is contained in:
@@ -102,6 +102,8 @@ MacroActionRunEdit::MacroActionRunEdit(
|
||||
SLOT(RemoveArg()));
|
||||
QWidget::connect(_argUp, SIGNAL(clicked()), this, SLOT(ArgUp()));
|
||||
QWidget::connect(_argDown, SIGNAL(clicked()), this, SLOT(ArgDown()));
|
||||
connect(_argList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this,
|
||||
SLOT(ArgItemClicked(QListWidgetItem *)));
|
||||
|
||||
auto *entryLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
@@ -235,6 +237,33 @@ void MacroActionRunEdit::ArgDown()
|
||||
}
|
||||
}
|
||||
|
||||
void MacroActionRunEdit::ArgItemClicked(QListWidgetItem *item)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string name;
|
||||
bool accepted = AdvSSNameDialog::AskForName(
|
||||
this,
|
||||
obs_module_text("AdvSceneSwitcher.action.run.addArgument"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.run.addArgumentDescription"),
|
||||
name, item->text(), 170, false);
|
||||
|
||||
if (!accepted || name.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto arg = QString::fromStdString(name);
|
||||
QVariant v = QVariant::fromValue(arg);
|
||||
item->setText(arg);
|
||||
item->setData(Qt::UserRole, arg);
|
||||
int idx = _argList->currentRow();
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
_entryData->_args[idx] = arg;
|
||||
}
|
||||
|
||||
void MacroActionRunEdit::SetArgListSize()
|
||||
{
|
||||
setHeightToContentHeight(_argList);
|
||||
|
||||
Reference in New Issue
Block a user