Skip to content

Commit

Permalink
Fix colorized icon with Qt5Compat.GraphicalEffects instead MultiEffec…
Browse files Browse the repository at this point in the history
…t from Qt6

At the moment, MultiEffect has limitations in its operation.
It does not work with black images. Therefore, the most logical solution would be to use the features from Qt5
  • Loading branch information
s-lisovenko committed Apr 7, 2024
1 parent 94912ee commit b062191
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ find_package(Qt6
TextToSpeech
Widgets
Xml
Core5Compat
OPTIONAL_COMPONENTS
LinguistTools
SerialPort
Expand Down
3 changes: 2 additions & 1 deletion QGCPostLinkCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ LinuxBuild {
libQt6LabsAnimation.so.6 \
libQt6Positioning.so.6 \
libQt6QuickDialogs2.so.6 \
libQt6Sql.so.6
libQt6Sql.so.6 \
libQt6Core5Compat.so.6

# Not all Qt libs are built in all systems. CI doesn't build Wayland, for example.
QT_LIB_OPTIONALS = ""
Expand Down
3 changes: 2 additions & 1 deletion qgroundcontrol.pro
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ QT += \
xml \
texttospeech \
core-private \
quick3d
quick3d \
core5compat

# Multimedia only used if QVC is enabled
!contains (DEFINES, QGC_DISABLE_UVC) {
Expand Down
11 changes: 5 additions & 6 deletions src/QmlControls/QGCColoredImage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
import Qt5Compat.GraphicalEffects

import QGroundControl.Palette

Expand Down Expand Up @@ -35,10 +35,9 @@ Item {
sourceSize.height: height
}

MultiEffect {
source: image
anchors.fill: image
colorizationColor: parent.color
colorization: 1.0
ColorOverlay {
anchors.fill: image
source: image
color: parent.color
}
}

0 comments on commit b062191

Please sign in to comment.