Skip to content

Commit

Permalink
Pref waveforms: disable the beats/time options if neither beats nor t…
Browse files Browse the repository at this point in the history
…ime is enabled
  • Loading branch information
ronso0 committed Jan 17, 2025
1 parent c038884 commit 533065f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/preferences/dialog/dlgprefwaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,15 @@ void DlgPrefWaveform::updateEnableUntilMark() {
#endif
untilMarkShowBeatsCheckBox->setEnabled(enabled);
untilMarkShowTimeCheckBox->setEnabled(enabled);
untilMarkAlignLabel->setEnabled(enabled);
untilMarkAlignComboBox->setEnabled(enabled);
untilMarkTextPointSizeLabel->setEnabled(enabled);
untilMarkTextPointSizeSpinBox->setEnabled(enabled);
untilMarkTextHeightLimitLabel->setEnabled(enabled);
untilMarkTextHeightLimitComboBox->setEnabled(enabled);
// Disable the beats/time options if neither beats nor time is enabled
bool beatsOrTimeEnabled = untilMarkShowBeatsCheckBox->isChecked() ||
untilMarkShowTimeCheckBox->isChecked();
untilMarkAlignLabel->setEnabled(beatsOrTimeEnabled);
untilMarkAlignComboBox->setEnabled(beatsOrTimeEnabled);
untilMarkTextPointSizeLabel->setEnabled(beatsOrTimeEnabled);
untilMarkTextPointSizeSpinBox->setEnabled(beatsOrTimeEnabled);
untilMarkTextHeightLimitLabel->setEnabled(beatsOrTimeEnabled);
untilMarkTextHeightLimitComboBox->setEnabled(beatsOrTimeEnabled);
requiresGLSLLabel->setVisible(!enabled && useWaveformCheckBox->isChecked());
}

Expand Down Expand Up @@ -649,10 +652,12 @@ void DlgPrefWaveform::slotSetPlayMarkerPosition(int position) {

void DlgPrefWaveform::slotSetUntilMarkShowBeats(bool checked) {
WaveformWidgetFactory::instance()->setUntilMarkShowBeats(checked);
updateEnableUntilMark();
}

void DlgPrefWaveform::slotSetUntilMarkShowTime(bool checked) {
WaveformWidgetFactory::instance()->setUntilMarkShowTime(checked);
updateEnableUntilMark();
}

void DlgPrefWaveform::slotSetUntilMarkAlign(int index) {
Expand Down

0 comments on commit 533065f

Please sign in to comment.