shift-shell/shell/contents/views/Desktop.qml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
2.2 KiB
QML
Raw Normal View History

2014-09-29 14:40:58 +00:00
/*
2021-03-01 20:03:25 +00:00
* SPDX-FileCopyrightText: 2014 Aaron Seigo <aseigo@kde.org>
* SPDX-FileCopyrightText: 2012 Marco Martin <notmart@gmail.com>
2014-09-29 14:40:58 +00:00
*
2021-03-01 20:03:25 +00:00
* SPDX-License-Identifier: LGPL-2.0-or-later
2014-09-29 14:40:58 +00:00
*/
import QtQuick 2.7
2014-09-29 19:38:56 +00:00
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3
import org.kde.plasma.core 2.0 as PlasmaCore
2014-09-29 11:32:55 +00:00
import org.kde.plasma.shell 2.0 as Shell
2014-11-09 12:50:03 +00:00
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
2018-02-13 13:16:48 +00:00
visible: false //adjust borders is run during setup. We want to avoid painting till completed
property Item containment
2018-02-13 13:16:48 +00:00
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 {
2020-07-16 11:48:53 +00:00
widgetExplorerStack.setSource(desktop.fileFromPackage("explorer", "WidgetExplorer.qml"), {"containment": containment, "containmentInterface": root.containment})
}
}
Loader {
id: widgetExplorerStack
z: 99
asynchronous: true
2020-07-16 11:48:53 +00:00
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)
2018-02-13 13:16:48 +00:00
item.leftPanelWidth = containment.availableScreenRect.x
item.rightPanelWidth = root.width - (containment.availableScreenRect.width + containment.availableScreenRect.x)
}
2014-09-29 17:15:21 +00:00
}
2014-09-29 14:40:58 +00:00
}
onContainmentChanged: {
containment.parent = root;
containment.visible = true;
containment.anchors.fill = root;
2018-02-13 13:16:48 +00:00
}
2014-09-29 11:32:55 +00:00
Component.onCompleted: {
visible = true
2014-09-29 11:32:55 +00:00
}
}