File: main.qml

package info (click to toggle)
plasma-mobile 6.3.6-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 18,612 kB
  • sloc: xml: 38,470; cpp: 18,437; javascript: 139; sh: 82; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// 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);
        }
    }
}