Improve demos for edge-to-edge mode

Set root window background correctly and add safe margins to
QML Window when needed so that demo apps look good also on
edge-to-edge mode.

Ideally, we could also set Qt.ExpandedClientAreaHint window
flag, but since Android doesn't handle status bar coloring
well yet, it's better to leave it until that's supported.

Pick-to: 6.9
Change-Id: I2bf55aaa990909dea340c195056afcd511960395
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5a5d0e5020)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2025-09-03 15:58:56 +03:00 committed by Qt Cherry-pick Bot
parent 85bd029d53
commit 0020b1f825
2 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,11 @@ Window {
id: root
anchors.fill: parent
anchors.topMargin: parent.SafeArea.margins.top
anchors.leftMargin: parent.SafeArea.margins.left
anchors.rightMargin: parent.SafeArea.margins.right
anchors.bottomMargin: parent.SafeArea.margins.bottom
readonly property int margin: 18
readonly property color backgroundColor: "#222222"
readonly property int minLandscapeModeWidth: numberPad.landscapeModeWidth

View File

@ -8,6 +8,11 @@ ApplicationWindow {
width: 1000
height: 600
title: qsTr("Coffee")
background: Rectangle {
color: Colors.currentTheme.background
}
//! [Set application window size]
ApplicationFlow {
width: parent.width