mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
66 lines
2.2 KiB
QML
66 lines
2.2 KiB
QML
/*
|
|
* SPDX-FileCopyrightText: 2014 Aaron Seigo <aseigo@kde.org>
|
|
* SPDX-FileCopyrightText: 2012 Marco Martin <notmart@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
import QtQuick 2.7
|
|
import QtGraphicalEffects 1.0
|
|
import QtQuick.Controls 2.3
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
import org.kde.plasma.shell 2.0 as Shell
|
|
import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
|
|
import org.kde.kquickcontrolsaddons 2.0
|
|
import org.kde.activities 0.1 as Activities
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
visible: false //adjust borders is run during setup. We want to avoid painting till completed
|
|
property Item containment
|
|
|
|
color: (containment && containment.backgroundHints == PlasmaCore.Types.NoBackground) ? "transparent" : PlasmaCore.Theme.textColor
|
|
|
|
function toggleWidgetExplorer(containment) {
|
|
console.log("Widget Explorer toggled");
|
|
if (widgetExplorerStack.source != "") {
|
|
widgetExplorerStack.source = "";
|
|
} else {
|
|
widgetExplorerStack.setSource(desktop.fileFromPackage("explorer", "WidgetExplorer.qml"), {"containment": containment, "containmentInterface": root.containment})
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
id: widgetExplorerStack
|
|
z: 99
|
|
asynchronous: true
|
|
y: containment ? containment.availableScreenRect.y : 0
|
|
height: containment ? containment.availableScreenRect.height : parent.height
|
|
width: parent.width
|
|
|
|
onLoaded: {
|
|
if (widgetExplorerStack.item) {
|
|
item.closed.connect(function() {
|
|
widgetExplorerStack.source = ""
|
|
});
|
|
|
|
item.topPanelHeight = containment.availableScreenRect.y
|
|
item.bottomPanelHeight = root.height - (containment.availableScreenRect.height + containment.availableScreenRect.y)
|
|
|
|
item.leftPanelWidth = containment.availableScreenRect.x
|
|
item.rightPanelWidth = root.width - (containment.availableScreenRect.width + containment.availableScreenRect.x)
|
|
}
|
|
}
|
|
}
|
|
|
|
onContainmentChanged: {
|
|
containment.parent = root;
|
|
containment.visible = true;
|
|
containment.anchors.fill = root;
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
visible = true
|
|
}
|
|
}
|