shift-shell/kwin/mobiletaskswitcher/package/contents/ui/main.qml
Devin Lin 28f7224a5b gestures: Add optional gesture guide panel
This adds a gesture handle mode to the navigation panel, which can be
enabled during gesture-only mode. This reserves space for the system
gesture to be able to be used, allowing us to extend the height in KWin
of the gesture recognition area (which is currently far too short for devices such as Pixel 3a).

This also allows for navigation with a mouse; clicking on the handle
triggers the task switcher, holding it triggers the "home" action.
2025-12-14 18:36:42 -05:00

42 lines
1.2 KiB
QML

// 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
import org.kde.plasma.private.mobileshell.state as MobileShellState
SceneEffect {
id: root
// Created per screen
delegate: TaskSwitcher {
id: taskSwitcher
state: taskSwitcherState
}
ShortcutHandler {
name: 'Mobile Task Switcher'
text: i18n("Toggle Mobile Task Switcher")
sequence: 'Meta+C'
onActivated: taskSwitcherState.toggle()
}
TaskSwitcherPlugin.MobileTaskSwitcherState {
id: taskSwitcherState
gestureEnabled: !ShellSettings.Settings.navigationPanelEnabled
&& !MobileShellState.ShellDBusClient.isActionDrawerOpen
&& !MobileShellState.ShellDBusClient.isVolumeOSDOpen
&& !MobileShellState.ShellDBusClient.isNotificationPopupDrawerOpen
Component.onCompleted: {
// Initialize with effect
taskSwitcherState.init(root);
}
}
}