Skip to content

Commit

Permalink
Enable high-DPI scaling to support 4k screens.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phoerious committed Oct 20, 2018
1 parent a44138d commit 37f6266
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/KMessageWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37f6266

Please sign in to comment.