From 79d66b84ddd2e822d0ce34f91af398a5c16694f7 Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Sun, 6 Jan 2019 10:37:26 -0500
Subject: [PATCH] mainwindow: set scaling value on show slot

Change-Id: I974bf732eae1701a53af790d55fce0d22eafbb28
---
 mainwindow.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mainwindow.cpp b/mainwindow.cpp
index a715cb3..4d99842 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -341,7 +341,9 @@ MainWindow::show()
     disconnect(screenChangedConnection_);
     screenChangedConnection_ = connect(windowHandle(), &QWindow::screenChanged,
                                        this, &MainWindow::slotScreenChanged);
-    currentScalingRatio_ = 1.0;
+    auto screenNumber = qApp->desktop()->screenNumber();
+    QScreen* screen = qApp->screens().at(screenNumber);
+    currentScalingRatio_ = screen->logicalDotsPerInchX() / 96;
     qobject_cast<NavWidget*>(ui->navStack->currentWidget())->updateCustomUI();
 }
 
-- 
GitLab