diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-24 11:52:12 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-24 15:46:56 +0000 |
commit | ac99683595e27b4157f9fd397fefa378955e275c (patch) | |
tree | 3f695edefe2d222f1f4765154a40875cb83ee147 | |
parent | c6cfb5cf5471e54f956176b668659767a065af99 (diff) |
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 <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/material/Drawer.qml | 15 |
1 files changed, 15 insertions, 0 deletions
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 |