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:
parent
857148efd6
commit
3229d1e3a1
1 changed files with 8 additions and 5 deletions
|
@ -77,14 +77,19 @@ void PreferencesGraph::syncSettings()
|
||||||
qPrefTechnicalDetails::set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN);
|
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)
|
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)
|
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)
|
void PreferencesGraph::on_buehlmann_toggled(bool buehlmann)
|
||||||
|
@ -96,5 +101,3 @@ void PreferencesGraph::on_buehlmann_toggled(bool buehlmann)
|
||||||
ui->vpmb_conservatism->setEnabled(!buehlmann);
|
ui->vpmb_conservatism->setEnabled(!buehlmann);
|
||||||
ui->label_VPMB->setEnabled(!buehlmann);
|
ui->label_VPMB->setEnabled(!buehlmann);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef DANGER_GF
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue