diff options
| author | Erik Prabowo Kamal <erik@darapsa.org> | 2025-12-12 18:27:50 +0800 |
|---|---|---|
| committer | Erik Prabowo Kamal <erik@darapsa.org> | 2025-12-12 18:27:50 +0800 |
| commit | e8f2d82e994973a274ec3a72cbb568baffb91ffc (patch) | |
| tree | d38d8cfdb29f4081b7e96bd12a1c939895f0a88d /Course/Detail/Classic | |
| parent | 93b25dfa97494184493e02b75766e57bc6fe79bb (diff) | |
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.
Diffstat (limited to 'Course/Detail/Classic')
| -rw-r--r-- | Course/Detail/Classic/Content/Main/TabContents/Instructor/ListInlineItem.ui.qml | 13 | ||||
| -rw-r--r-- | Course/Detail/Classic/Content/Sidebar/Video.ui.qml | 13 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Course/Detail/Classic/Content/Main/TabContents/Instructor/ListInlineItem.ui.qml b/Course/Detail/Classic/Content/Main/TabContents/Instructor/ListInlineItem.ui.qml index 0851fd7..9eb36dc 100644 --- a/Course/Detail/Classic/Content/Main/TabContents/Instructor/ListInlineItem.ui.qml +++ b/Course/Detail/Classic/Content/Main/TabContents/Instructor/ListInlineItem.ui.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import Qt5Compat.GraphicalEffects +import QtQuick.Effects RowLayout { @@ -25,10 +25,13 @@ RowLayout { Layout.minimumHeight: 12 Layout.minimumWidth: 12 - ColorOverlay { - anchors.fill: inlineItemIcon - source: inlineItemIcon - color: "#fd7e14" + layer { + enabled:true + effect: MultiEffect { + brightness: 1.0 + colorization: 1.0 + colorizationColor: "#fd7e14" + } } } } 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 + } } } |