diff --git a/main.cpp b/main.cpp index cb55ab29..a2b576a5 100644 --- a/main.cpp +++ b/main.cpp @@ -124,6 +124,20 @@ int main(int argc, char *argv[]) qDebug() << "app startd"; + // screen settings + // Mobile is designed on 128dpi + qreal ref_dpi = 128; + QRect geo = QApplication::desktop()->availableGeometry(); + QRect rect = QGuiApplication::primaryScreen()->geometry(); + qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch(); + qreal physicalDpi = QGuiApplication::primaryScreen()->physicalDotsPerInch(); + qreal calculated_ratio = physicalDpi/ref_dpi; + + qWarning().nospace() << "Qt:" << QT_VERSION_STR << " | screen: " << rect.width() + << "x" << rect.height() << " - dpi: " << dpi << " - ratio:" + << calculated_ratio; + + // registering types for QML qmlRegisterType("moneroComponents.Clipboard", 1, 0, "Clipboard"); @@ -221,17 +235,6 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("isIOS", isIOS); engine.rootContext()->setContextProperty("isAndroid", isAndroid); - // screen settings - // Mobile is designed on 128dpi - qreal ref_dpi = 128; - QRect geo = QApplication::desktop()->availableGeometry(); - QRect rect = QGuiApplication::primaryScreen()->geometry(); - qreal height = qMax(rect.width(), rect.height()); - qreal width = qMin(rect.width(), rect.height()); - qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch(); - qreal physicalDpi = QGuiApplication::primaryScreen()->physicalDotsPerInch(); - qreal calculated_ratio = physicalDpi/ref_dpi; - engine.rootContext()->setContextProperty("screenWidth", geo.width()); engine.rootContext()->setContextProperty("screenHeight", geo.height()); #ifdef Q_OS_ANDROID @@ -240,9 +243,6 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("scaleRatio", 1); #endif - qWarning().nospace() << "Qt:" << QT_VERSION_STR << " | screen: " << width - << "x" << height << " - dpi: " << dpi << " - ratio:" - << calculated_ratio; if (!moneroAccountsRootDir.empty()) { QString moneroAccountsDir = moneroAccountsRootDir.at(0) + "/Monero/wallets";