diff options
Diffstat (limited to 'src/quickcontrols/material/Drawer.qml')
-rw-r--r-- | src/quickcontrols/material/Drawer.qml | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/quickcontrols/material/Drawer.qml b/src/quickcontrols/material/Drawer.qml index ecfe8836b9..fc31a19a84 100644 --- a/src/quickcontrols/material/Drawer.qml +++ b/src/quickcontrols/material/Drawer.qml @@ -3,6 +3,7 @@ import QtQuick import QtQuick.Templates as T +import QtQuick.Controls.impl import QtQuick.Controls.Material import QtQuick.Controls.Material.impl @@ -16,33 +17,32 @@ T.Drawer { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) - topPadding: !dim && edge === Qt.BottomEdge && Material.elevation === 0 - leftPadding: !dim && edge === Qt.RightEdge && Material.elevation === 0 - rightPadding: !dim && edge === Qt.LeftEdge && Material.elevation === 0 - bottomPadding: !dim && edge === Qt.TopEdge && Material.elevation === 0 + topPadding: edge !== Qt.TopEdge ? Material.roundedScale : 0 + bottomPadding: edge !== Qt.BottomEdge ? Material.roundedScale : 0 enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } - Material.elevation: !interactive && !dim ? 0 : 16 + // https://m3.material.io/components/navigation-drawer/specs#e616dc8f-d61a-4d56-a311-50c68ecda744 + Material.elevation: !interactive && !dim ? 0 : 1 + Material.roundedScale: Material.LargeScale - background: Rectangle { + background: PaddedRectangle { + // https://m3.material.io/components/navigation-drawer/specs#ce8bfbcf-3dec-45d2-9d8b-5e10af1cf87d + implicitWidth: 360 color: control.Material.dialogColor - - Rectangle { - readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge - width: horizontal ? 1 : parent.width - height: horizontal ? parent.height : 1 - color: control.Material.dividerColor - x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0 - y: control.edge === Qt.TopEdge ? parent.height - 1 : 0 - visible: !control.dim && control.Material.elevation === 0 - } - - layer.enabled: control.position > 0 - layer.effect: ElevationEffect { + // FullScale doesn't make sense for Drawer. + radius: control.Material.roundedScale + leftPadding: edge === Qt.LeftEdge ? -radius : 0 + rightPadding: edge === Qt.RightEdge ? -radius : 0 + topPadding: edge === Qt.TopEdge ? -radius : 0 + bottomPadding: edge === Qt.BottomEdge ? -radius : 0 + clip: true + + layer.enabled: control.position > 0 && control.Material.elevation > 0 + layer.effect: RoundedElevationEffect { elevation: control.Material.elevation - fullHeight: true + roundedScale: control.background.radius } } |