mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-15 08:29:22 -05:00
Improve theme colour contrast.
Fixes #4407 Fixes #4637 Additional changes: - Fix reference entry colour being incompatible with dark themes - Fix QWizard page being too bright in dark mode - Prevent unfocused wheel scroll changes to theme setting
This commit is contained in:
parent
1a3dc2145d
commit
8d2f7832ed
9 changed files with 82 additions and 53 deletions
|
|
@ -283,12 +283,11 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||
foregroundColor.setNamedColor(entry->foregroundColor());
|
||||
if (entry->hasReferences()) {
|
||||
QPalette p;
|
||||
#ifdef Q_OS_MACOS
|
||||
if (macUtils()->isDarkMode()) {
|
||||
return QVariant(p.color(QPalette::Inactive, QPalette::Dark));
|
||||
}
|
||||
#endif
|
||||
return QVariant(p.color(QPalette::Active, QPalette::Mid));
|
||||
foregroundColor = p.color(QPalette::Current, QPalette::Text);
|
||||
int lightness =
|
||||
qMin(255, qMax(0, foregroundColor.lightness() + (foregroundColor.lightness() < 110 ? 85 : -51)));
|
||||
foregroundColor.setHsl(foregroundColor.hue(), foregroundColor.saturation(), lightness);
|
||||
return QVariant(foregroundColor);
|
||||
} else if (foregroundColor.isValid()) {
|
||||
return QVariant(foregroundColor);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue