mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 07:04:42 +02:00
Android - Resize bottombar after window size changes (to always fill the screen horizontally)
This commit is contained in:
parent
7789697243
commit
79ff2df860
1 changed files with 18 additions and 5 deletions
|
@ -106,11 +106,24 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function relocateAndResize(newWindowWidth, newWindowHeight) {
|
||||||
|
width = newWindowWidth;
|
||||||
|
y = newWindowHeight - height;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onWindowGeometryChanged(rect) {
|
||||||
|
relocateAndResize(rect.width, rect.height);
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// put on bottom
|
// put on bottom
|
||||||
width = Window.innerWidth;
|
|
||||||
height = 255;
|
height = 255;
|
||||||
y = Window.innerHeight - height;
|
relocateAndResize(Window.innerWidth, Window.innerHeight);
|
||||||
|
Window.geometryChanged.connect(onWindowGeometryChanged); // In devices with bars appearing at startup we should listen for this
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
Window.geometryChanged.disconnect(onWindowGeometryChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addButton(properties) {
|
function addButton(properties) {
|
||||||
|
|
Loading…
Reference in a new issue