fix qml break for kf5 <= 5.68

BUG:426119
pull/20/head
Michail Vourlakos 4 years ago
parent c5472593fe
commit 00fca8cdb0

@ -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{

@ -1,5 +1,5 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* 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))
}

@ -0,0 +1,25 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
Rectangle {
visible: false
}
Loading…
Cancel
Save