Skip to content

Commit

Permalink
Simplified the logic for showing/hiding MIDI controller tabs by intro…
Browse files Browse the repository at this point in the history
…ducing a boolean variable
  • Loading branch information
JoergAtGithub committed Dec 30, 2024
1 parent e9ce649 commit 1621866
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/controllers/dlgprefcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,15 +778,11 @@ void DlgPrefController::slotMappingSelected(int chosenIndex) {
}

// These tabs are only usable for MIDI controllers
if (m_pController->getDataRepresentationProtocol() == DataRepresentationProtocol::MIDI &&
!mappingFilePath.isEmpty()) {
m_ui.controllerTabs->setTabVisible(m_inputMappingsTabIndex, true);
m_ui.controllerTabs->setTabVisible(m_outputMappingsTabIndex, true);

} else {
m_ui.controllerTabs->setTabVisible(m_inputMappingsTabIndex, false);
m_ui.controllerTabs->setTabVisible(m_outputMappingsTabIndex, false);
}
bool showMidiTabs = m_pController->getDataRepresentationProtocol() ==
DataRepresentationProtocol::MIDI &&
!mappingFilePath.isEmpty();
m_ui.controllerTabs->setTabVisible(m_inputMappingsTabIndex, showMidiTabs);
m_ui.controllerTabs->setTabVisible(m_outputMappingsTabIndex, showMidiTabs);

// Hide the entire QTabWidget if all tabs are removed
m_ui.controllerTabs->setVisible(getNumberOfVisibleTabs() > 0);
Expand Down

0 comments on commit 1621866

Please sign in to comment.