shift-shell/components/mobileshellstate/qml/HomeScreenControls.qml
Devin Lin bdcbe4d6f7 mobileshellstate: Heavily refactor to remove global shell margins to fix window binding loops
Having a global set margins and orientation (that were calculated from the panel containment) caused a lot of issues with the way bindings were evaluated across panels, and with high coupling.

Now use properties from within containments to determine shell margins instead, which removes the dependency on other containments for measurements. This allows us to get rid of TaskPanelControls as well!

Fixes: https://invent.kde.org/teams/plasma-mobile/issues/-/issues/198
2022-12-10 21:05:13 -05:00

39 lines
1.1 KiB
QML

// SPDX-FileCopyrightText: 2020 Marco Martin <mart@kde.org>
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick 2.12
import QtQuick.Window 2.2
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
pragma Singleton
/**
* Provides access to the homescreen plasmoid containment within the shell.
*/
QtObject {
id: root
signal openHomeScreen()
signal resetHomeScreenPosition()
signal requestRelativeScroll(point pos)
signal openAppLaunchAnimation(string splashIcon, string title, real x, real y, real sourceIconSize)
signal closeAppLaunchAnimation()
property var taskSwitcher
property QtObject homeScreenWindow
property bool taskSwitcherVisible: false
// this state is updated from WindowUtil
property bool homeScreenVisible: true
property var windowListener: Connections {
target: MobileShell.WindowUtil
function onAllWindowsMinimizedChanged() {
root.homeScreenVisible = MobileShell.WindowUtil.allWindowsMinimized
}
}
}