mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Allow accessing macro properties even without selecting any macro
This commit is contained in:
parent
1a8b185f7d
commit
e8c1b673c0
|
|
@ -799,7 +799,7 @@
|
|||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<widget class="QWidget" name="macroConditions" native="true">
|
||||
<layout class="QVBoxLayout" name="macroConditionsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
|
|
@ -941,7 +941,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<widget class="QWidget" name="macroActions" native="true">
|
||||
<layout class="QVBoxLayout" name="macroActionsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public:
|
|||
bool addNewMacro(std::string &name, std::string format = "");
|
||||
Macro *getSelectedMacro();
|
||||
void SetEditMacro(Macro &m);
|
||||
void SetMacroEditAreaDisabled(bool);
|
||||
void HighlightAction(int idx);
|
||||
void HighlightCondition(int idx);
|
||||
void PopulateMacroActions(Macro &m, uint32_t afterIdx = 0);
|
||||
|
|
|
|||
|
|
@ -312,13 +312,24 @@ void AdvSceneSwitcher::SetEditMacro(Macro &m)
|
|||
|
||||
PopulateMacroConditions(m);
|
||||
PopulateMacroActions(m);
|
||||
ui->macroEdit->setDisabled(false);
|
||||
SetMacroEditAreaDisabled(false);
|
||||
|
||||
currentActionIdx = -1;
|
||||
currentConditionIdx = -1;
|
||||
HighlightControls();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::SetMacroEditAreaDisabled(bool disable)
|
||||
{
|
||||
ui->macroName->setDisabled(disable);
|
||||
ui->runMacro->setDisabled(disable);
|
||||
ui->runMacroInParallel->setDisabled(disable);
|
||||
ui->runMacroOnChange->setDisabled(disable);
|
||||
ui->macroActions->setDisabled(disable);
|
||||
ui->macroConditions->setDisabled(disable);
|
||||
ui->macroSplitter->setDisabled(disable);
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::HighlightAction(int idx)
|
||||
{
|
||||
actionsList->Highlight(idx);
|
||||
|
|
@ -348,7 +359,7 @@ void AdvSceneSwitcher::on_macros_currentRowChanged(int idx)
|
|||
}
|
||||
|
||||
if (idx == -1) {
|
||||
ui->macroEdit->setDisabled(true);
|
||||
SetMacroEditAreaDisabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -460,8 +471,7 @@ void AdvSceneSwitcher::setupMacroTab()
|
|||
connect(conditionsList, &QWidget::customContextMenuRequested, this,
|
||||
&AdvSceneSwitcher::ShowMacroConditionsContextMenu);
|
||||
|
||||
ui->macroEdit->setDisabled(true);
|
||||
|
||||
SetMacroEditAreaDisabled(true);
|
||||
ui->macroPriorityWarning->setVisible(
|
||||
switcher->functionNamesByPriority[0] != macro_func);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user