diff options
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index e04cd0c1..488a9b01 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1326,12 +1326,12 @@ void ColorSettings::setColorSeparatorScrollbar(bool b) QColor ColorSettings::idealTextColor(const QColor& rBackgroundColor) { - if (rBackgroundColor.alpha() == 0) + if (rBackgroundColor.alpha() < 50) return QColor(Qt::black); - const int THRESHOLD = 106 * 255.0f / rBackgroundColor.alpha(); - int BackgroundDelta = (rBackgroundColor.red() * 0.299) + (rBackgroundColor.green() * 0.587) + (rBackgroundColor.blue() * 0.114); - return QColor((255 - BackgroundDelta <= THRESHOLD) ? Qt::black : Qt::white); + // "inverse' of luminance of the background + int iLuminance = (rBackgroundColor.red() * 0.299) + (rBackgroundColor.green() * 0.587) + (rBackgroundColor.blue() * 0.114); + return QColor(iLuminance >= 128 ? Qt::black : Qt::white); } @@ -2195,6 +2195,26 @@ void InterfaceSettings::setCollapsibleSeparatorsConflicts(bool b) set(m_Settings, "Settings", "collapsible_separators_conflicts", b); } +bool InterfaceSettings::collapsibleSeparatorsPerProfile() const +{ + return get<bool>(m_Settings, "Settings", "collapsible_separators_per_profile", false); +} + +void InterfaceSettings::setCollapsibleSeparatorsPerProfile(bool b) +{ + set(m_Settings, "Settings", "collapsible_separators_per_profile", b); +} + +bool InterfaceSettings::saveFilters() const +{ + return get<bool>(m_Settings, "Settings", "save_filters", false); +} + +void InterfaceSettings::setSaveFilters(bool b) +{ + set(m_Settings, "Settings", "save_filters", b); +} + bool InterfaceSettings::compactDownloads() const { return get<bool>(m_Settings, "Settings", "compact_downloads", false); |
