From 00522884ae15464c2d524edec762bf6fe4a38fec Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 27 Apr 2020 11:56:41 -0700 Subject: [PATCH] Add DropShadow --- qml/theme/CwtchDark.qml | 1 + qml/theme/CwtchLight.qml | 1 + qml/theme/Theme.qml | 4 +++- qml/theme/ThemeType.qml | 2 ++ qml/widgets/ButtonTextField.qml | 10 ++++++++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/qml/theme/CwtchDark.qml b/qml/theme/CwtchDark.qml index b3849ff6..e7e039af 100644 --- a/qml/theme/CwtchDark.qml +++ b/qml/theme/CwtchDark.qml @@ -30,4 +30,5 @@ ThemeType { portraitContactBadgeColor: hotPink portraitContactBadgeTextColor: whitePurple portraitProfileBadgeColor: mauvePurple + dropShadowColor: darkGrayPurple } \ No newline at end of file diff --git a/qml/theme/CwtchLight.qml b/qml/theme/CwtchLight.qml index aad84706..cf68189f 100644 --- a/qml/theme/CwtchLight.qml +++ b/qml/theme/CwtchLight.qml @@ -30,4 +30,5 @@ ThemeType { portraitContactBadgeColor: hotPink portraitContactBadgeTextColor: whitePurple portraitProfileBadgeColor: brightPurple + dropShadowColor: purple } \ No newline at end of file diff --git a/qml/theme/Theme.qml b/qml/theme/Theme.qml index ce61e4ab..859d0de4 100644 --- a/qml/theme/Theme.qml +++ b/qml/theme/Theme.qml @@ -11,6 +11,8 @@ Item { readonly property color defaultButtonActiveColor: theme.defaultButtonActiveColor readonly property color defaultButtonTextColor: theme.defaultButtonTextColor + readonly property color dropShadowColor: theme.dropShadowColor + readonly property color portraitOnlineBorderColor: theme.portraitOnlineBorderColor readonly property color portraitOnlineBackgroundColor: theme.portraitOnlineBackgroundColor readonly property color portraitOnlineTextColor: theme.portraitOnlineTextColor @@ -36,5 +38,5 @@ Item { readonly property int sidePaneMinSize: 700 readonly property int doublePaneMinSize: 1000 - property ThemeType theme: CwtchDark{ } + property ThemeType theme: CwtchLight { } } \ No newline at end of file diff --git a/qml/theme/ThemeType.qml b/qml/theme/ThemeType.qml index 174c190a..c4ff5af4 100644 --- a/qml/theme/ThemeType.qml +++ b/qml/theme/ThemeType.qml @@ -22,6 +22,8 @@ QtObject { property color portraitContactBadgeColor: "red" property color portraitContactBadgeTextColor: "red" property color portraitProfileBadgeColor: "red" + property color dropShadowColor: "black" + // ... more to come diff --git a/qml/widgets/ButtonTextField.qml b/qml/widgets/ButtonTextField.qml index 9f5227ef..e600c222 100644 --- a/qml/widgets/ButtonTextField.qml +++ b/qml/widgets/ButtonTextField.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.13 import QtQuick.Controls.Styles 1.4 +import QtGraphicalEffects 1.12 import "." as Widgets import "../theme" @@ -20,6 +21,14 @@ TextField { radius: 10 color: Theme.backgroundMainColor border.color: Theme.backgroundMainColor + layer.enabled: true + layer.effect: DropShadow { + transparentBorder: true + horizontalOffset: 4 + verticalOffset: 4 + samples:10 + color: Theme.dropShadowColor + } } Widgets.Button { @@ -34,4 +43,5 @@ TextField { parent.clicked(); } } + } \ No newline at end of file