From 0106ef82f26d3a94e3aba667a57ab844eaf0a5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 21 Jan 2025 22:35:36 +0100 Subject: [PATCH] Fixed changing blend mode in Properties view Last minute cleanup cleaned up a little too much. We need the list of values, because they don't match the indexes in the names list... --- src/tiled/propertieswidget.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/tiled/propertieswidget.cpp b/src/tiled/propertieswidget.cpp index 773afe04b2..0fbc82238b 100644 --- a/src/tiled/propertieswidget.cpp +++ b/src/tiled/propertieswidget.cpp @@ -197,7 +197,7 @@ template<> EnumData enumData() template<> EnumData enumData() { - return {{ + const QStringList names = { QCoreApplication::translate("BlendMode", "Normal"), QCoreApplication::translate("BlendMode", "Add"), QCoreApplication::translate("BlendMode", "Multiply"), @@ -211,7 +211,23 @@ template<> EnumData enumData() QCoreApplication::translate("BlendMode", "Soft Light"), QCoreApplication::translate("BlendMode", "Difference"), QCoreApplication::translate("BlendMode", "Exclusion"), - }}; + }; + static const QList values = { + static_cast(BlendMode::Normal), + static_cast(BlendMode::Add), + static_cast(BlendMode::Multiply), + static_cast(BlendMode::Screen), + static_cast(BlendMode::Overlay), + static_cast(BlendMode::Darken), + static_cast(BlendMode::Lighten), + static_cast(BlendMode::ColorDodge), + static_cast(BlendMode::ColorBurn), + static_cast(BlendMode::HardLight), + static_cast(BlendMode::SoftLight), + static_cast(BlendMode::Difference), + static_cast(BlendMode::Exclusion), + }; + return { names, values }; }