From ac99683595e27b4157f9fd397fefa378955e275c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 24 Nov 2016 11:52:12 +0100 Subject: Material Drawer: show a separator line when it has no dim nor elevation This makes a non-dimmed and non-elevated Drawer stand out from the content. Other styles have such separator line always visible. Change-Id: I58a75fbcabcca09248ec4c94ec22338967fbfe87 Reviewed-by: Mitch Curtis --- src/imports/controls/material/Drawer.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/imports/controls/material') diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index c7f4825c..7b401b5b 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -50,6 +50,11 @@ T.Drawer { contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + 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 + enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } @@ -58,6 +63,16 @@ T.Drawer { background: Rectangle { 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 { elevation: control.Material.elevation -- cgit v1.2.3