2025-03-01 21:26:47 +00:00
|
|
|
// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
|
|
|
|
|
import org.kde.kwin
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.private.mobileshell.taskswitcherplugin as TaskSwitcherPlugin
|
|
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
2025-03-19 01:21:46 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
2025-03-01 21:26:47 +00:00
|
|
|
|
|
|
|
|
SceneEffect {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
// Created per screen
|
|
|
|
|
delegate: TaskSwitcher {
|
|
|
|
|
id: taskSwitcher
|
|
|
|
|
state: taskSwitcherState
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ShortcutHandler {
|
|
|
|
|
name: 'Mobile Task Switcher'
|
2025-08-10 18:52:25 +00:00
|
|
|
text: i18n("Toggle Mobile Task Switcher")
|
2025-03-01 21:26:47 +00:00
|
|
|
sequence: 'Meta+C'
|
|
|
|
|
|
|
|
|
|
onActivated: taskSwitcherState.toggle()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskSwitcherPlugin.MobileTaskSwitcherState {
|
|
|
|
|
id: taskSwitcherState
|
|
|
|
|
|
2025-12-14 04:38:13 +00:00
|
|
|
gestureEnabled: !ShellSettings.Settings.navigationPanelEnabled
|
|
|
|
|
&& !MobileShellState.ShellDBusClient.isActionDrawerOpen
|
|
|
|
|
&& !MobileShellState.ShellDBusClient.isVolumeOSDOpen
|
|
|
|
|
&& !MobileShellState.ShellDBusClient.isNotificationPopupDrawerOpen
|
2025-03-01 21:26:47 +00:00
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
// Initialize with effect
|
|
|
|
|
taskSwitcherState.init(root);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-10 18:52:25 +00:00
|
|
|
}
|