Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/views/Desktop.qml
Show All 21 Lines | |||||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.kwindowsystem 1.0 | 24 | import org.kde.kwindowsystem 1.0 | ||
25 | import org.kde.plasma.activityswitcher 1.0 as ActivitySwitcher | 25 | import org.kde.plasma.activityswitcher 1.0 as ActivitySwitcher | ||
26 | import org.kde.plasma.shell 2.0 as Shell | 26 | import org.kde.plasma.shell 2.0 as Shell | ||
27 | import "../activitymanager" | 27 | import "../activitymanager" | ||
28 | import "../explorer" | 28 | import "../explorer" | ||
29 | 29 | | |||
30 | 30 | MouseArea { | |||
31 | Item { | | |||
32 | id: root | 31 | id: root | ||
33 | 32 | | |||
34 | property Item containment | 33 | property Item containment | ||
35 | 34 | | |||
36 | property QtObject widgetExplorer | 35 | property QtObject widgetExplorer | ||
37 | 36 | | |||
38 | Connections { | 37 | Connections { | ||
39 | target: ActivitySwitcher.Backend | 38 | target: ActivitySwitcher.Backend | ||
40 | onShouldShowSwitcherChanged: { | 39 | onShouldShowSwitcherChanged: { | ||
41 | if (ActivitySwitcher.Backend.shouldShowSwitcher) { | 40 | if (ActivitySwitcher.Backend.shouldShowSwitcher) { | ||
42 | if (sidePanelStack.state != "activityManager") { | 41 | if (sidePanelStack.state != "activityManager") { | ||
43 | root.toggleActivityManager(); | 42 | root.toggleActivityManager(); | ||
44 | } | 43 | } | ||
45 | 44 | | |||
46 | } else { | 45 | } else { | ||
47 | if (sidePanelStack.state == "activityManager") { | 46 | if (sidePanelStack.state == "activityManager") { | ||
48 | root.toggleActivityManager(); | 47 | root.toggleActivityManager(); | ||
49 | } | 48 | } | ||
50 | 49 | | |||
51 | } | 50 | } | ||
52 | } | 51 | } | ||
53 | } | 52 | } | ||
53 | onPressAndHold: { | ||||
54 | containment.showContextMenu(Qt.point(mouse.x, mouse.y), "RightButton;NoModifier") | ||||
55 | } | ||||
54 | 56 | | |||
55 | function toggleWidgetExplorer(containment) { | 57 | function toggleWidgetExplorer(containment) { | ||
56 | // console.log("Widget Explorer toggled"); | 58 | // console.log("Widget Explorer toggled"); | ||
57 | 59 | | |||
58 | if (sidePanelStack.state == "widgetExplorer") { | 60 | if (sidePanelStack.state == "widgetExplorer") { | ||
59 | sidePanelStack.state = "closed"; | 61 | sidePanelStack.state = "closed"; | ||
60 | } else { | 62 | } else { | ||
61 | sidePanelStack.state = "widgetExplorer"; | 63 | sidePanelStack.state = "widgetExplorer"; | ||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |