Enable high-DPI scaling to support 4k screens.

This enables coordinate system scaling for high-DPI
displays, which enforces correct proportions even
on small 4k displays. The icons are scaled up without
interpolation, which makes them crisp, but a bit
pixelated. A new scalable icon set will solve this
problem, but is not scope of this patch.

Resolves #548, #1381, #1710, #1888

In addition, this patch enforces the KeePassXC icon
theme for the KMessageBox close icon, since using
the system theme produces very ugly icons on some
Linux systems.
This commit is contained in:
Janek Bevendorff 2018-10-20 12:18:33 +02:00
parent a44138dd5c
commit b45f0e3e46
2 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
QAction *closeAction = new QAction(q);
closeAction->setText(KMessageWidget::tr("&Close"));
closeAction->setToolTip(KMessageWidget::tr("Close message"));
closeAction->setIcon(FilePath::instance()->icon("actions", "message-close"));
closeAction->setIcon(FilePath::instance()->icon("actions", "message-close", false));
QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(animatedHide()));

View File

@ -46,6 +46,10 @@ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
int main(int argc, char** argv)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
Application app(argc, argv);
Application::setApplicationName("keepassxc");
Application::setApplicationVersion(KEEPASSXC_VERSION);