aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Popup.qml
diff options
context:
space:
mode:
authorMichael Spencer <sonrisesoftware@gmail.com>2016-04-29 10:36:52 -0500
committerMichael Spencer <sonrisesoftware@gmail.com>2016-05-04 19:49:46 +0000
commit251afe3eaac3367c5c659dddc1e8854f833d5112 (patch)
treeb746a7a99b148f44b9da9f7008cbe814c1193438 /src/imports/controls/material/Popup.qml
parentaa6af36630b6aa07c8b67dfd4cbdcfecc8362cb1 (diff)
Material: Add proper elevation support
- Added an ElevationEffect component based on elevation shadows from Angular Material - Use it on Button, ToolBar, ComboBox, Drawer, Pane, Popup, Menu, and Switch - Add an elevation property to the Material attached object - Update the button colors based on the elevation property Change-Id: I5152e1a56bdcb1016cc4f945a16ef510e0cdece6 Task-number: QTBUG-51276 Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/material/Popup.qml')
-rw-r--r--src/imports/controls/material/Popup.qml12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml
index 08bfaa19..4f1db60e 100644
--- a/src/imports/controls/material/Popup.qml
+++ b/src/imports/controls/material/Popup.qml
@@ -38,10 +38,13 @@ import QtQuick 2.6
import QtGraphicalEffects 1.0
import QtQuick.Templates 2.0 as T
import QtQuick.Controls.Material 2.0
+import QtQuick.Controls.Material.impl 2.0
T.Popup {
id: control
+ Material.elevation: 24
+
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
@@ -70,12 +73,9 @@ T.Popup {
radius: 3
color: control.Material.dialogColor
- layer.enabled: true
- layer.effect: DropShadow {
- verticalOffset: 1
- color: control.Material.dropShadowColor
- samples: 15
- spread: 0.5
+ layer.enabled: control.Material.elevation > 0
+ layer.effect: ElevationEffect {
+ elevation: control.Material.elevation
}
}
}