summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-28 15:19:56 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-28 15:20:21 +0800
commit334044f98e4d0e96214c40d43ffa239a82ca5248 (patch)
tree201c20894936b9f36b40daa9771930c45bbdb433
parentaf3c42108149b41fc272e02b7dc2f51e1da0ec1f (diff)
bs-box-shadow implementation & its use in Card
-rw-r--r--DropShadow/Box.ui.qml11
-rw-r--r--Eduport.qrc1
-rw-r--r--Home/Default/Card.ui.qml6
-rw-r--r--imports/Eduport/Eduport.qml5
4 files changed, 19 insertions, 4 deletions
diff --git a/DropShadow/Box.ui.qml b/DropShadow/Box.ui.qml
new file mode 100644
index 0000000..774b0d3
--- /dev/null
+++ b/DropShadow/Box.ui.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.15
+import QtGraphicalEffects 1.15
+import Eduport 1.4
+
+DropShadow {
+ horizontalOffset: Eduport.bsBoxShadowOffsetX
+ verticalOffset: Eduport.bsBoxShadowOffsetY
+ radius: Eduport.bsBoxShadowBlurRadius / 5
+ samples: radius * 2 + 1
+ color: Eduport.bsBoxShadowColor
+}
diff --git a/Eduport.qrc b/Eduport.qrc
index d38e19d..e997993 100644
--- a/Eduport.qrc
+++ b/Eduport.qrc
@@ -5,6 +5,7 @@
<file>Heebo/Heebo-Regular.ttf</file>
<file>imports/Eduport/Eduport.qml</file>
<file>imports/Eduport/qmldir</file>
+ <file>DropShadow/Box.ui.qml</file>
<file>Label/Body.ui.qml</file>
<file>Label/FwLight.ui.qml</file>
<file>Label/H6.ui.qml</file>
diff --git a/Home/Default/Card.ui.qml b/Home/Default/Card.ui.qml
index 36e9239..9fc3ff5 100644
--- a/Home/Default/Card.ui.qml
+++ b/Home/Default/Card.ui.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
import Eduport 1.4
+import "../../DropShadow" as DrpShdw
import "../../Label" as Lbl
Item {
@@ -22,11 +23,8 @@ Item {
property string truncatedText: "Far advanced settling say finished raillery. Offered chiefly farther"
property real rating: 4.0
- DropShadow {
+ DrpShdw.Box {
source: rectangle
- color: "#261d3a53"
- radius: 5
- samples: 11
anchors.fill: rectangle
}
diff --git a/imports/Eduport/Eduport.qml b/imports/Eduport/Eduport.qml
index 63cc239..c11d03a 100644
--- a/imports/Eduport/Eduport.qml
+++ b/imports/Eduport/Eduport.qml
@@ -37,6 +37,11 @@ QtObject {
readonly property color bsPrimary: "#066ac9"
readonly property real bsBadgeFontSize: 13.6
+ property real bsBoxShadowOffsetX: 0
+ property real bsBoxShadowOffsetY: 0
+ property int bsBoxShadowBlurRadius: 40
+ property color bsBoxShadowColor: "#261d3a53"
+
readonly property real bsBtnPaddingX: 16
readonly property real bsBtnPaddingY: 8
readonly property font bsBtnFont: Qt.font({