aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_defaults.cpp
diff options
context:
space:
mode:
authorGravatar willemferguson <willemferguson@zoology.up.ac.za>2020-11-01 20:43:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-03 23:08:39 -0800
commit8b36cf10518c54d76134686a3e079bbde176022b (patch)
tree2ad17a80d75c585ba6ac2887c9dc2a427a65e15c /desktop-widgets/preferences/preferences_defaults.cpp
parent1ff488a4392f4d9a41cf1652c351e7b59bc03928 (diff)
downloadsubsurface-8b36cf10518c54d76134686a3e079bbde176022b.tar.gz
desktop: offer different colors for info tab titles
Add a preference option to set the color of the text on the information tab to either MediumBlue, LightBlue or Black. The last two of these colors are meant to enable areadable font contrast on displays with dark mode. The choice is saved with the other preferences. [Dirk Hohndel: this isn't really about dark mode, so changed many of the types and variable names, changed the user visible texts, and addressed some whitespace issues] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/preferences/preferences_defaults.cpp')
-rw-r--r--desktop-widgets/preferences/preferences_defaults.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/preferences/preferences_defaults.cpp b/desktop-widgets/preferences/preferences_defaults.cpp
index ca1b51acb..3fba8e1b8 100644
--- a/desktop-widgets/preferences/preferences_defaults.cpp
+++ b/desktop-widgets/preferences/preferences_defaults.cpp
@@ -24,6 +24,7 @@ PreferencesDefaults::~PreferencesDefaults()
void PreferencesDefaults::refreshSettings()
{
+ prefs.headerstyle_color == BLACK ? ui->black_text->setChecked(true) : (prefs.headerstyle_color == LIGHTBLUE ? ui->lightblue_text->setChecked(true) : ui->mediumblue_text->setChecked(true));
ui->font->setCurrentFont(qPrefDisplay::divelist_font());
ui->fontsize->setValue(qPrefDisplay::font_size());
ui->velocitySlider->setValue(qPrefDisplay::animation_speed());
@@ -35,4 +36,6 @@ void PreferencesDefaults::syncSettings()
qPrefDisplay::set_divelist_font(ui->font->currentFont().toString());
qPrefDisplay::set_font_size(ui->fontsize->value());
qPrefDisplay::set_animation_speed(ui->velocitySlider->value());
+ qPrefDisplay::set_headerstyle_color(ui->black_text->isChecked() ? BLACK : (ui->lightblue_text->isChecked() ? LIGHTBLUE : MEDIUMBLUE));
+
}