mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 11:22:10 +02:00
Merge pull request #12665 from gcalero/android_bottombar_resize
Android - Resize bottombar after window size changes (to always fill …
This commit is contained in:
commit
bbded2215d
1 changed files with 19 additions and 6 deletions
|
@ -25,6 +25,7 @@ import "."
|
||||||
Item {
|
Item {
|
||||||
id: bar
|
id: bar
|
||||||
x:0
|
x:0
|
||||||
|
height: 255
|
||||||
|
|
||||||
property bool shown: true
|
property bool shown: true
|
||||||
|
|
||||||
|
@ -45,10 +46,10 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
anchors.fill : parent
|
anchors.fill : parent
|
||||||
color: "#FF000000"
|
color: "#FF000000"
|
||||||
border.color: "#FFFFFF"
|
border.color: "#FFFFFF"
|
||||||
anchors.bottomMargin: -1
|
anchors.bottomMargin: -1
|
||||||
anchors.leftMargin: -1
|
anchors.leftMargin: -1
|
||||||
|
@ -104,13 +105,25 @@ 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;
|
relocateAndResize(Window.innerWidth, Window.innerHeight);
|
||||||
height = 255;
|
Window.geometryChanged.connect(onWindowGeometryChanged); // In devices with bars appearing at startup we should listen for this
|
||||||
y = Window.innerHeight - height;
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
Window.geometryChanged.disconnect(onWindowGeometryChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addButton(properties) {
|
function addButton(properties) {
|
||||||
|
|
Loading…
Reference in a new issue