From d71942a538dd9fd9e335cd32639e78eb9aad90e1 Mon Sep 17 00:00:00 2001 From: Erik Prabowo Kamal Date: Fri, 12 Dec 2025 22:03:27 +0800 Subject: Reimplement Qt5 OpacityMask using Qt6 MultiEffect Remaining ones. See 93b25dfa97494184493e02b75766e57bc6fe79bb https://darapsa.org/qeduport.git/commit/?id=93b25dfa97494184493e02b75766e57bc6fe79bb --- Student/Dashboard/CourseListItem.ui.qml | 40 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'Student') diff --git a/Student/Dashboard/CourseListItem.ui.qml b/Student/Dashboard/CourseListItem.ui.qml index ee5e657..cc2b04e 100644 --- a/Student/Dashboard/CourseListItem.ui.qml +++ b/Student/Dashboard/CourseListItem.ui.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import Qt5Compat.GraphicalEffects +import QtQuick.Effects import Bootstrap RowLayout { @@ -12,29 +12,33 @@ RowLayout { property alias courseListActionButton: courseListActionButton spacing: 16 - Rectangle { - id: courseThumbnail - radius: 8 - Layout.preferredHeight: 72 - Layout.preferredWidth: 100 - Layout.minimumHeight: 72 - Layout.minimumWidth: 100 - Image { - id: courseThumb - source: "https://eduport.webestica.com/assets/images/courses/4by3/08.jpg" - sourceSize: Qt.size(parent.width, parent.height) - visible: false + Image { + id: courseThumb + source: "https://eduport.webestica.com/assets/images/courses/4by3/08.jpg" + sourceSize { + width: 100 + height: 75 + } + layer { + enabled: true + effect: MultiEffect { + maskEnabled: true + maskSource: maskRectangle + } } - OpacityMask{ - anchors.fill: courseThumbnail - source: courseThumb - maskSource: courseThumbnail + Rectangle { + id: maskRectangle + width: courseThumb.sourceSize.width + height: courseThumb.sourceSize.height + radius: 8 + layer.enabled: true + visible: false } } ColumnLayout{ id: courseProgressInfo spacing: 0 - width: parent.width - image.width - spacing + width: parent.width - courseThumb.width - spacing Label{ id: courseTitle -- cgit v1.2.3