diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index a95ba0f88..408641eb4 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -144,9 +144,12 @@ bool FrameSvg::hasElementPrefix(const QString &prefix) const //because it could make sense for certain themes to not have all the elements if (prefix.isEmpty()) { return hasElement(QStringLiteral("center")); - } else { - return hasElement(prefix % QLatin1String("-center")); } + if (prefix.endsWith(QLatin1Char('-'))) { + return hasElement(prefix % QLatin1String("center")); + } + + return hasElement(prefix % QLatin1String("-center")); } bool FrameSvg::hasElementPrefix(Plasma::Types::Location location) const diff --git a/src/plasma/framesvg.h b/src/plasma/framesvg.h index 23d6e9d4d..3a63c0b70 100644 --- a/src/plasma/framesvg.h +++ b/src/plasma/framesvg.h @@ -212,7 +212,7 @@ public: /** * @return true if the svg has the necessary elements with the given prefix * to draw a frame - * @param prefix the given prefix we want to check if drawable + * @param prefix the given prefix we want to check if drawable (can have trailing '-' since 5.59) */ Q_INVOKABLE bool hasElementPrefix(const QString &prefix) const;