Skip to content

Commit

Permalink
Disable slider (non-interactive) if input is connected in expander
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-L committed Dec 13, 2021
1 parent ecc4569 commit cea5099
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/Cardinal/src/Ildaeil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,9 +1396,16 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
}
else
{
bool expanderPresent = (module->leftExpander.module && module->leftExpander.module->model == modelIldaeilExpIn8);
const bool disabled = expanderPresent && (i < 8) && (module->leftExpander.module->inputs[i].isConnected());
if (disabled)
ImGui::BeginDisabled();
const bool ret = param.log
? ImGui::SliderFloat(param.name, &ui->values[i], param.min, param.max, param.format, 2.0f)
: ImGui::SliderFloat(param.name, &ui->values[i], param.min, param.max, param.format);
if (disabled)
ImGui::EndDisabled();

if (ret)
{
if (ImGui::IsItemActivated())
Expand Down

0 comments on commit cea5099

Please sign in to comment.