1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

preferences: replace macro by local function

No apparent reason for having this as a hard-to-read macro.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-09 09:25:24 +01:00 committed by Michael Keller
parent 857148efd6
commit 3229d1e3a1

View file

@ -77,14 +77,19 @@ void PreferencesGraph::syncSettings()
qPrefTechnicalDetails::set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN);
}
#define DANGER_GF (gf > 100) ? "* { color: red; }" : ""
static const char *danger_gf(int gf)
{
return (gf > 100) ? "* { color: red; }" : "";
}
void PreferencesGraph::on_gflow_valueChanged(int gf)
{
ui->gflow->setStyleSheet(DANGER_GF);
ui->gflow->setStyleSheet(danger_gf(gf));
}
void PreferencesGraph::on_gfhigh_valueChanged(int gf)
{
ui->gfhigh->setStyleSheet(DANGER_GF);
ui->gfhigh->setStyleSheet(danger_gf(gf));
}
void PreferencesGraph::on_buehlmann_toggled(bool buehlmann)
@ -96,5 +101,3 @@ void PreferencesGraph::on_buehlmann_toggled(bool buehlmann)
ui->vpmb_conservatism->setEnabled(!buehlmann);
ui->label_VPMB->setEnabled(!buehlmann);
}
#undef DANGER_GF