Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) apply macOS style to dynamically added sliders, too #12631

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/preferences/dialog/dlgpreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ DlgPreferences::DlgPreferences(
m_pConfig(pSettingsManager->settings()),
m_pageSizeHint(QSize(0, 0)) {
setupUi(this);
// This applies only to sliders that are created by .ui files.
// For dynamically added sliders, e.g. main EQ sliers in DlgPrefMixer, this
// needs to be called again per slider.
fixSliderStyle();
contentsTreeWidget->setHeaderHidden(true);

Expand Down
11 changes: 9 additions & 2 deletions src/preferences/dialog/dlgprefmixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,12 @@ void DlgPrefMixer::setUpMainEQ() {
if (configuredIndex == -1) {
return;
}
// Set index and create required sliders and labels
comboBoxMainEq->setCurrentIndex(configuredIndex);
// Set index and create required sliders and labels.
// Call the update slot directly so we can be sure all sliders have been
// created when we set their properties below.
comboBoxMainEq->blockSignals(true);
slotMainEqEffectChanged(configuredIndex);
comboBoxMainEq->blockSignals(false);

// Load parameters from preferences and set sliders
for (QSlider* pSlider : std::as_const(m_mainEQSliders)) {
Expand Down Expand Up @@ -1158,6 +1162,9 @@ void DlgPrefMixer::slotMainEqEffectChanged(int effectIndex) {

m_mainEQValues.append(pValueLabel);
slidersGridLayout->addWidget(pValueLabel, 2, i + 1, Qt::AlignCenter);

// Make sure the macOS-specific style is applied for this new widget
style()->polish(pSlider);
}
}

Expand Down
Loading