diff --git a/orion.pro.user b/orion.pro.user index db6a3b0..c31b993 100644 --- a/orion.pro.user +++ b/orion.pro.user @@ -1,14 +1,10 @@ -<<<<<<< HEAD - -======= - ->>>>>>> 688c288dd1164ae82bcbb378e2b50909fcbb81e2 + EnvironmentId - {2e9efdd3-a2f9-4310-9b96-36b240683d97} + {c67d4384-b61d-42ef-9d03-8c42dcb6aba9} ProjectExplorer.Project.ActiveTarget @@ -62,14 +58,14 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.5.0 MinGW 32bit - Desktop Qt 5.5.0 MinGW 32bit - qt.55.win32_mingw492_kit - 1 + Qt 5.5.1 in PATH (lib) + Qt 5.5.1 in PATH (lib) + {485b3ad0-aff6-4ae5-8136-3a101e100ee4} + 0 0 0 - C:/Users/Antti L/git/build-orion-Desktop_Qt_5_5_0_MinGW_32bit-Debug + /home/antti/git/build-orion-Qt_5_5_1_in_PATH_lib-Debug true @@ -77,7 +73,6 @@ QtProjectManager.QMakeBuildStep true - false false false @@ -88,7 +83,10 @@ Make Qt4ProjectManager.MakeStep - + + -w + -r + false @@ -104,7 +102,10 @@ Make Qt4ProjectManager.MakeStep - + + -w + -r + true clean @@ -116,7 +117,9 @@ 2 false - + + LD_LIBRARY_PATH=lib + Debug Qt4ProjectManager.Qt4BuildConfiguration @@ -124,7 +127,7 @@ true - C:/Users/Antti L/git/build-orion-Desktop_Qt_5_5_0_MinGW_32bit-Release + /home/antti/git/build-orion-Qt_5_5_1_in_PATH_lib-Release true @@ -132,7 +135,6 @@ QtProjectManager.QMakeBuildStep false - true false false @@ -143,7 +145,10 @@ Make Qt4ProjectManager.MakeStep - + + -w + -r + false @@ -159,7 +164,10 @@ Make Qt4ProjectManager.MakeStep - + + -w + -r + true clean @@ -178,7 +186,67 @@ 0 true - 2 + + /home/antti/git/build-orion-Qt_5_5_1_in_PATH_lib-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 0 @@ -194,6 +262,10 @@ 1 + false + 1000 + + true false false @@ -231,8 +303,9 @@ 2 orion - - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Antti L/git/orion/orion.pro + orion2 + Qt4ProjectManager.Qt4RunConfiguration:/home/antti/git/orion/orion.pro + true orion.pro false diff --git a/src/main.cpp b/src/main.cpp index 573a928..66e31e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,10 +42,23 @@ int main(int argc, char *argv[]) Power *power = new Power(); QQmlApplicationEngine engine; - float dpi = QGuiApplication::primaryScreen()->physicalDotsPerInch() * QGuiApplication::primaryScreen()->devicePixelRatio(); + float dpi; - //Original screen ppi ratio I started working with was 157.29. Scaling interface relative to this value. - dpi /= 157.29; +#ifdef Q_OS_LINUX + dpi = QGuiApplication::primaryScreen()->physicalDotsPerInch() * QGuiApplication::primaryScreen()->devicePixelRatio() / 96; + +#elif defined(Q_OS_WIN) + dpi = QGuiApplication::primaryScreen()->physicalDotsPerInch() * QGuiApplication::primaryScreen()->devicePixelRatio() / 96; + +#else //Osx + dpi = 1; + +#endif + + + +// //Original screen ppi ratio I started working with was 157.29. Scaling interface relative to this value. +// dpi /= 157.29; qDebug() << "DPI ratio: " << dpi; @@ -53,7 +66,7 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("g_cman", cman); engine.rootContext()->setContextProperty("g_guard", &guard); engine.rootContext()->setContextProperty("g_powerman", power); - engine.rootContext()->setContextProperty("g_ppi", QVariant::fromValue(dpi)); + engine.rootContext()->setContextProperty("g_dpi", QVariant::fromValue(dpi)); engine.rootContext()->setContextProperty("g_favourites", cman->getFavouritesProxy()); engine.rootContext()->setContextProperty("g_results", cman->getResultsModel()); engine.rootContext()->setContextProperty("g_featured", cman->getFeaturedProxy()); diff --git a/src/qml/main.qml b/src/qml/main.qml index bec4fbc..f26d7ee 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -18,8 +18,9 @@ ApplicationWindow { property bool g_contextMenuVisible: false property bool g_fullscreen: false + //function for scaling UI function dp(number){ - return Math.ceil(number * g_ppi) + return Math.ceil(number * g_dpi * .666) } Connections { @@ -56,6 +57,8 @@ ApplicationWindow { top: parent.top bottom: parent.bottom } + + Component.onCompleted: toggle() } Item {