diff options
author | Scott Murray <scott.murray@konsulko.com> | 2021-02-01 18:13:28 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2021-02-01 18:17:28 -0500 |
commit | b587bf9d453f29656c2a52bc486881c0e3cb67c6 (patch) | |
tree | 6796d301c402308f385fa94c455b83093bacd109 /app/Main.qml | |
parent | 3b0e548c3adae12e72cc6d6dc22f5ecc475aa7c2 (diff) |
Tweak things to center the windowmarlin_12.90.0marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.012.90.011.92.011.91.0
Add a onCompleted hook in Main.qml to set it's x and y coordinates to
center the window, and rework instantiation of the qml in main.cpp so
that the resulting x and y values can be queried and used in a call to
set_window_props to actually position the window.
Bug-AGL: SPEC-3784
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I46e2dfac7c62c9afd379fd6bf7b7fa3277422cbc
Diffstat (limited to 'app/Main.qml')
-rw-r--r-- | app/Main.qml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Main.qml b/app/Main.qml index 4011107..0b60d5c 100644 --- a/app/Main.qml +++ b/app/Main.qml @@ -29,6 +29,12 @@ Window { visible: true flags: Qt.FramelessWindowHint + Component.onCompleted: { + // Center window + root.x = root.screen.virtualX + root.screen.width / 2 - root.width / 2; + root.y = root.screen.virtualY + root.screen.height / 2 - root.height / 2; + } + BodyTemplateDialog { id: bodyTemplate anchors.centerIn: parent |