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:
Janek Bevendorff committed 2020-04-28 23:35:03 +02:00
1 parent 1a3dc2145d
commit 8d2f7832ed
9 files changed
+82 -53

No files matched your search

+15
View File
@@ -26,6 +26,8 @@
#include "core/Resources.h"
#include "format/KeePass2.h"
#include <QFrame>
#include <QPalette>
#include <QVBoxLayout>
NewDatabaseWizard::NewDatabaseWizard(QWidget* parent)
@@ -50,6 +52,19 @@ NewDatabaseWizard::NewDatabaseWizard(QWidget* parent)
Q_INIT_RESOURCE(wizard);
setPixmap(QWizard::BackgroundPixmap, QPixmap(":/wizard/background-pixmap.png"));
// Fix MacStyle QWizard page frame too bright in dark mode (QTBUG-70346, QTBUG-71696)
QPalette defaultPalette;
auto windowColor = defaultPalette.color(QPalette::Window);
windowColor.setAlpha(153);
auto baseColor = defaultPalette.color(QPalette::Base);
baseColor.setAlpha(153);
auto* pageFrame = findChildren<QFrame*>()[0];
auto framePalette = pageFrame->palette();
framePalette.setBrush(QPalette::Window, windowColor.lighter(120));
framePalette.setBrush(QPalette::Base, baseColor.lighter(120));
pageFrame->setPalette(framePalette);
}
NewDatabaseWizard::~NewDatabaseWizard()