[core] Add new parameter to BaseApp/Preferences/Dialog called DontUseNativeColorDialog, default to true

This commit is contained in:
mwganson
2021-12-24 13:41:54 -06:00
committed by wwmayer
parent 7f0bc597a5
commit 9976b4cf84
2 changed files with 20 additions and 2 deletions

View File

@@ -782,7 +782,11 @@ void ColorButton::onChooseColor()
if (d->modal) {
QColor currentColor = d->col;
QColorDialog cd(d->col, this);
cd.setOptions(QColorDialog::DontUseNativeDialog);
ParameterGrp::handle group = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Dialog");
bool notNativeColorDialog = group->GetBool("DontUseNativeColorDialog", true);
if (notNativeColorDialog)
cd.setOptions(QColorDialog::DontUseNativeDialog);
cd.setOption(QColorDialog::ColorDialogOption::ShowAlphaChannel, d->allowTransparency);
if (d->autoChange) {
@@ -808,7 +812,11 @@ void ColorButton::onChooseColor()
if (d->cd.isNull()) {
d->old = d->col;
d->cd = new QColorDialog(d->col, this);
d->cd->setOptions(QColorDialog::DontUseNativeDialog);
ParameterGrp::handle group = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Dialog");
bool notNativeColorDialog = group->GetBool("DontUseNativeColorDialog", true);
if (notNativeColorDialog)
d->cd->setOptions(QColorDialog::DontUseNativeDialog);
d->cd->setOption(QColorDialog::ColorDialogOption::ShowAlphaChannel, d->allowTransparency);
d->cd->setAttribute(Qt::WA_DeleteOnClose);
connect(d->cd, SIGNAL(rejected()),