2015-03-13 21:16:19 +00:00
|
|
|
/*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
|
2015-03-13 21:16:19 +00:00
|
|
|
*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2015-03-13 21:16:19 +00:00
|
|
|
*/
|
|
|
|
|
|
2023-06-13 00:49:54 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
2015-03-13 21:16:19 +00:00
|
|
|
|
2023-06-13 00:49:54 +00:00
|
|
|
import org.kde.plasma.core as PlasmaCore
|
2015-03-13 21:16:19 +00:00
|
|
|
|
2017-09-05 15:25:48 +00:00
|
|
|
Rectangle {
|
2015-03-13 21:16:19 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
visible: false //adjust borders is run during setup. We want to avoid painting till completed
|
|
|
|
|
property Item containment
|
|
|
|
|
|
2023-07-25 01:13:52 +00:00
|
|
|
color: !containment || containment.plasmoid.backgroundHints == PlasmaCore.Types.NoBackground ? "transparent" : Kirigami.Theme.textColor
|
2017-09-05 15:25:48 +00:00
|
|
|
|
2015-03-13 21:16:19 +00:00
|
|
|
onContainmentChanged: {
|
|
|
|
|
containment.parent = root;
|
|
|
|
|
containment.visible = true;
|
|
|
|
|
containment.anchors.fill = root;
|
2023-10-17 05:12:44 +00:00
|
|
|
|
|
|
|
|
// HACK: add PanelView into the containment so that it can be used
|
|
|
|
|
if (containment.panel !== undefined) {
|
|
|
|
|
containment.panel = panel;
|
|
|
|
|
}
|
2023-06-13 00:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
|
target: panel
|
|
|
|
|
property: "backgroundHints"
|
|
|
|
|
when: containment
|
|
|
|
|
value: {
|
|
|
|
|
if (!containment) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return containment.plasmoid.backgroundHints;
|
|
|
|
|
}
|
|
|
|
|
restoreMode: Binding.RestoreBinding
|
2015-03-13 21:16:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
visible = true
|
|
|
|
|
}
|
|
|
|
|
}
|