diff --git a/containment/package/contents/ui/colorizer/CustomBackground.qml b/containment/package/contents/ui/colorizer/CustomBackground.qml index 289cf8e84..122dfdc8f 100644 --- a/containment/package/contents/ui/colorizer/CustomBackground.qml +++ b/containment/package/contents/ui/colorizer/CustomBackground.qml @@ -113,14 +113,9 @@ Item{ id: kirigamiRect anchors.fill: painter active: root.kirigamiLibraryIsFound && main.shadowSize>0 - sourceComponent: KirigamiShadowedRectangle { - radius: painter.radius - color: "transparent" - shadow.size: main.shadowSize - //! WORKAROUND, plasma theme shadow color compared to KirigamiShadowedRectangle drawn shadow has an alpha difference. This way - //! we make sure that when the user uses the same shadow size with plasma theme original one we draw the same shadow compared visually - shadow.color: Qt.rgba(main.shadowColor.r, main.shadowColor.g, main.shadowColor.b, Math.min(1, 0.336 + main.shadowColor.a)) - } + //! this "source" approach is needed in order for KF5<=5.68 to load Latte correctly with no + //! qml breakage because Kirigami2.ShadowedRectangle is not present + source: root.kirigamiLibraryIsFound ? "KirigamiShadowedRectangle.qml" : "NormalRectangle.qml" } Rectangle{ diff --git a/containment/package/contents/ui/colorizer/KirigamiShadowedRectangle.qml b/containment/package/contents/ui/colorizer/KirigamiShadowedRectangle.qml index 367feda26..788857ee6 100644 --- a/containment/package/contents/ui/colorizer/KirigamiShadowedRectangle.qml +++ b/containment/package/contents/ui/colorizer/KirigamiShadowedRectangle.qml @@ -1,5 +1,5 @@ /* -* Copyright 2018 Michail Vourlakos +* Copyright 2020 Michail Vourlakos * * This file is part of Latte-Dock * @@ -25,4 +25,10 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.12 as Kirigami Kirigami.ShadowedRectangle { + radius: painter.radius + color: "transparent" + shadow.size: main.shadowSize + //! WORKAROUND, plasma theme shadow color compared to KirigamiShadowedRectangle drawn shadow has an alpha difference. This way + //! we make sure that when the user uses the same shadow size with plasma theme original one we draw the same shadow compared visually + shadow.color: Qt.rgba(main.shadowColor.r, main.shadowColor.g, main.shadowColor.b, Math.min(1, 0.336 + main.shadowColor.a)) } diff --git a/containment/package/contents/ui/colorizer/NormalRectangle.qml b/containment/package/contents/ui/colorizer/NormalRectangle.qml new file mode 100644 index 000000000..1f8ee4c49 --- /dev/null +++ b/containment/package/contents/ui/colorizer/NormalRectangle.qml @@ -0,0 +1,25 @@ +/* +* Copyright 2020 Michail Vourlakos +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +import QtQuick 2.7 + +Rectangle { + visible: false +} +