From 974bc40e90649d5b3de00e2bed4bd84d47ba527c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sun, 29 Dec 2024 18:55:57 +0100 Subject: [PATCH] Replace DropShadow with a prerendered shadow image to boost performance --- YACReaderLibrary/qml.qrc | 1 + YACReaderLibrary/qml/GridComicsView.qml | 22 ++++++++++------- YACReaderLibrary/qml/GridComicsView6.qml | 23 ++++++++++-------- .../qml/prerendered_cover_shadow.png | Bin 0 -> 289 bytes YACReaderLibrary/qml6.qrc | 1 + 5 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 YACReaderLibrary/qml/prerendered_cover_shadow.png diff --git a/YACReaderLibrary/qml.qrc b/YACReaderLibrary/qml.qrc index 676430e3..8bdd2e31 100644 --- a/YACReaderLibrary/qml.qrc +++ b/YACReaderLibrary/qml.qrc @@ -27,5 +27,6 @@ qml/InfoTick.qml qml/InfoFavorites.qml qml/InfoRating.qml + qml/prerendered_cover_shadow.png diff --git a/YACReaderLibrary/qml/GridComicsView.qml b/YACReaderLibrary/qml/GridComicsView.qml index b43a0288..bede0f79 100644 --- a/YACReaderLibrary/qml/GridComicsView.qml +++ b/YACReaderLibrary/qml/GridComicsView.qml @@ -65,15 +65,19 @@ SplitView { NumberAnimation { duration: 90 } } - DropShadow { - anchors.fill: realCell - horizontalOffset: 0 - verticalOffset: 0 - radius: 8.0 - samples: 17 - color: "#FF000000" - source: realCell - visible: showDropShadow; + BorderImage { + anchors { + top: realCell.top + left: realCell.left + right: realCell.right + bottom: realCell.bottom + margins: -10 + } + border { left: 10; top: 10; right: 10; bottom: 10 } + horizontalTileMode: BorderImage.Stretch + verticalTileMode: BorderImage.Stretch + source: "prerendered_cover_shadow.png" + visible: showDropShadow } Rectangle { diff --git a/YACReaderLibrary/qml/GridComicsView6.qml b/YACReaderLibrary/qml/GridComicsView6.qml index a8ced7fc..75aad7cc 100644 --- a/YACReaderLibrary/qml/GridComicsView6.qml +++ b/YACReaderLibrary/qml/GridComicsView6.qml @@ -67,16 +67,19 @@ SplitView { NumberAnimation { duration: 90 } } - DropShadow { - anchors.fill: realCell - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 0 - radius: 10.0 - //samples: 17 - color: "#FF000000" - source: realCell - visible: showDropShadow; + BorderImage { + anchors { + top: realCell.top + left: realCell.left + right: realCell.right + bottom: realCell.bottom + margins: -10 + } + border { left: 10; top: 10; right: 10; bottom: 10 } + horizontalTileMode: BorderImage.Stretch + verticalTileMode: BorderImage.Stretch + source: "prerendered_cover_shadow.png" + visible: showDropShadow } Rectangle { diff --git a/YACReaderLibrary/qml/prerendered_cover_shadow.png b/YACReaderLibrary/qml/prerendered_cover_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..6f693bc6bcbd31c0b5d5e3174714c6515eca1a32 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RYI14-?iy0WWg+Z8+Vb&Z8px|Xs z7sn8b-ltP;^EDgrILn3|`~UyljuQTEQ{f}HZyVpDSH;L66 zY}Qe~eWzlX*|Z-<2P7n?Y?Rbp@i4LXoZ14_GwlIQRt)0&O`NlACp1O}6i2)dWU*qD zu-$&DPS{H!^cw>kL-_q@hC42bq3aH~&l6+kV``PJb%{F?yJFR{qJ-ET!2!9Fa>5bv zKTEs?%^tp7SY@^FqMu~Q)r;motitN~R+UdR^87u)wX=3s)P*L!#J?ZqMH6S{=ZkvT j*Swr|De-^p=lhJeW~Z{MZK%2q^d5t!tDnm{r-UW|qml/info-tag@2x.png qml/info-tick.png qml/info-tick@2x.png + qml/prerendered_cover_shadow.png