aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-01 07:03:02 +0000
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-08-02 07:37:43 +0000
commiteda63f75f575f802847eaf839d9a98b7a6885529 (patch)
tree1b8b90c8badb79d55ed52de91302018a38fca97c
parent761c15a8ab0c0b390e1cff84ad5d33d48b99ed98 (diff)
Improve output of multiple screen resolution
To improve output on various monitor with various resolution, use scale_factor from WM to fit various screen resolution. Bug-AGL: SPEC-1568, SPEC-1569, SPEC-1611 Change-Id: I527b0e96900afd4c0fcbea3cebf2ae800d9cf4ab Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-rw-r--r--homescreen/qml/main.qml2
-rw-r--r--homescreen/src/main.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml
index 1312e87..96a1950 100644
--- a/homescreen/qml/main.qml
+++ b/homescreen/qml/main.qml
@@ -32,7 +32,7 @@ Window {
anchors.centerIn: parent
width: 1080
height: 1920
- scale: 1.0
+ scale: screenInfo.scale_factor()
source: './images/AGL_HMI_Blue_Background_NoCar-01.png'
ColumnLayout {
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp
index 39903e8..620c869 100644
--- a/homescreen/src/main.cpp
+++ b/homescreen/src/main.cpp
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
parser.addVersionOption();
parser.process(a);
QStringList positionalArguments = parser.positionalArguments();
-
+
int port = 1700;
QString token = "wm";
@@ -97,6 +97,8 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ AGLScreenInfo screenInfo(layoutHandler->get_scale_factor());
+
if (layoutHandler->requestSurface(QString("HomeScreen")) != 0) {
exit(EXIT_FAILURE);
}
@@ -136,6 +138,7 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("launcher", launcher);
engine.rootContext()->setContextProperty("weather", new Weather(bindingAddress));
engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddress));
+ engine.rootContext()->setContextProperty("screenInfo", &screenInfo);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
QObject *root = engine.rootObjects().first();