From e8f2d82e994973a274ec3a72cbb568baffb91ffc Mon Sep 17 00:00:00 2001 From: Erik Prabowo Kamal Date: Fri, 12 Dec 2025 18:27:50 +0800 Subject: Reimplement Qt5 ColorOverlay using Qt6 MultiEffect https://stackoverflow.com/questions/70809206/color-overlay-an-image-in-qml-qt6#77060406 Even though the answer is not checked, but the Qt6.8 works, and after following the suggestion in its comment about brightness. The MultiEffect needs to be put outside of the Image when they're on a Button. Having MultiEffect as the Image layer's effect only works when it's not on a Button. --- Course/Detail/Classic/Content/Sidebar/Video.ui.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Course/Detail/Classic/Content/Sidebar/Video.ui.qml') diff --git a/Course/Detail/Classic/Content/Sidebar/Video.ui.qml b/Course/Detail/Classic/Content/Sidebar/Video.ui.qml index 5c22f05..5c46ea2 100644 --- a/Course/Detail/Classic/Content/Sidebar/Video.ui.qml +++ b/Course/Detail/Classic/Content/Sidebar/Video.ui.qml @@ -1,7 +1,6 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import Qt5Compat.GraphicalEffects import QtQuick.Effects import QtMultimedia import Bootstrap @@ -134,11 +133,13 @@ ColumnLayout { height: 15 } - ColorOverlay { - anchors.fill: parent - source: parent - color: Eduport - .bsDanger + layer { + enabled: true + effect: MultiEffect { + brightness: 1.0 + colorization: 1.0 + colorizationColor: Eduport.bsDanger + } } } -- cgit v1.2.3