mirror of https://github.com/qt/qtdoc.git
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. Change-Id: I2bf55aaa990909dea340c195056afcd511960395 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit5a5d0e5020
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit0020b1f825
)
This commit is contained in:
parent
3fbdda43e7
commit
842a61aa2c
|
@ -20,6 +20,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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue