mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
Make PlasmoidItem accessible from HomeScreen
it needs availableScreenRect which can be provided only from PlasmoidITem
This commit is contained in:
parent
2a3f66f199
commit
69dc189941
3 changed files with 11 additions and 4 deletions
|
|
@ -47,6 +47,11 @@ Item {
|
|||
*/
|
||||
readonly property bool overlayShown: startupFeedback.visible
|
||||
|
||||
/**
|
||||
* The root PlasmoidItem of the containment this is used into
|
||||
*/
|
||||
property PlasmoidItem plasmoidItem
|
||||
|
||||
/**
|
||||
* Margins for the homescreen, taking panels into account.
|
||||
*/
|
||||
|
|
@ -56,11 +61,11 @@ Item {
|
|||
property real rightMargin
|
||||
|
||||
function evaluateMargins() {
|
||||
topMargin = Plasmoid.availableScreenRect.y
|
||||
topMargin = plasmoidItem.availableScreenRect.y
|
||||
// add a specific check for the nav panel for now, since the gesture mode still technically has height
|
||||
bottomMargin = ShellSettings.Settings.navigationPanelEnabled ? root.height - (Plasmoid.availableScreenRect.y + Plasmoid.availableScreenRect.height) : 0;
|
||||
leftMargin = Plasmoid.availableScreenRect.x
|
||||
rightMargin = root.width - (Plasmoid.availableScreenRect.x + Plasmoid.availableScreenRect.width)
|
||||
bottomMargin = ShellSettings.Settings.navigationPanelEnabled ? root.height - (plasmoidItem.availableScreenRect.y + plasmoidItem.availableScreenRect.height) : 0;
|
||||
leftMargin = plasmoidItem.availableScreenRect.x
|
||||
rightMargin = root.width - (plasmoidItem.availableScreenRect.x + plasmoidItem.availableScreenRect.width)
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ ContainmentItem {
|
|||
MobileShell.HomeScreen {
|
||||
id: homeScreen
|
||||
|
||||
plasmoidItem: root
|
||||
onResetHomeScreenPosition: {
|
||||
folioHomeScreen.homeScreenState.animateGoToPageIndex(0, Kirigami.Units.longDuration);
|
||||
folioHomeScreen.homeScreenState.closeAppDrawer();
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ ContainmentItem {
|
|||
MobileShell.HomeScreen {
|
||||
id: homeScreen
|
||||
anchors.fill: parent
|
||||
plasmoidItem: root
|
||||
|
||||
onResetHomeScreenPosition: {
|
||||
halcyonHomeScreen.triggerHomescreen();
|
||||
|
|
|
|||
Loading…
Reference in a new issue