Changeset View
Changeset View
Standalone View
Standalone View
applets/pager/package/contents/ui/main.qml
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 30 | MouseArea { | |||
---|---|---|---|---|---|
49 | property bool dragging: false | 49 | property bool dragging: false | ||
50 | property int dragId | 50 | property int dragId | ||
51 | 51 | | |||
52 | property int dragSwitchDesktopId: -1 | 52 | property int dragSwitchDesktopId: -1 | ||
53 | 53 | | |||
54 | anchors.fill: parent | 54 | anchors.fill: parent | ||
55 | acceptedButtons: Qt.NoButton | 55 | acceptedButtons: Qt.NoButton | ||
56 | 56 | | |||
57 | hoverEnabled: true | ||||
58 | | ||||
57 | function colorWithAlpha(color, alpha) { | 59 | function colorWithAlpha(color, alpha) { | ||
58 | return Qt.rgba(color.r, color.g, color.b, alpha) | 60 | return Qt.rgba(color.r, color.g, color.b, alpha) | ||
59 | } | 61 | } | ||
60 | 62 | | |||
61 | readonly property color windowActiveOnActiveDesktopColor: colorWithAlpha(theme.textColor, 0.6) | 63 | readonly property color windowActiveOnActiveDesktopColor: colorWithAlpha(theme.textColor, 0.6) | ||
62 | readonly property color windowInactiveOnActiveDesktopColor: colorWithAlpha(theme.textColor, 0.35) | 64 | readonly property color windowInactiveOnActiveDesktopColor: colorWithAlpha(theme.textColor, 0.35) | ||
63 | readonly property color windowActiveColor: colorWithAlpha(theme.textColor, 0.5) | 65 | readonly property color windowActiveColor: colorWithAlpha(theme.textColor, 0.5) | ||
64 | readonly property color windowActiveBorderColor: theme.textColor | 66 | readonly property color windowActiveBorderColor: theme.textColor | ||
Show All 19 Lines | 84 | activityDataSource = Qt.createQmlObject('import org.kde.plasma.core 2.0 as PlasmaCore; \ | |||
84 | connectedSources: ["Status"] }', root); | 86 | connectedSources: ["Status"] }', root); | ||
85 | } | 87 | } | ||
86 | 88 | | |||
87 | var service = activityDataSource.serviceForSource("Status") | 89 | var service = activityDataSource.serviceForSource("Status") | ||
88 | var operation = service.operationDescription("toggleActivityManager") | 90 | var operation = service.operationDescription("toggleActivityManager") | ||
89 | service.startOperationCall(operation) | 91 | service.startOperationCall(operation) | ||
90 | } | 92 | } | ||
91 | 93 | | |||
94 | onContainsMouseChanged: { | ||||
95 | if (!containsMouse && dragging) { | ||||
96 | // Somewhat heavy-handed way to clean up after a window delegate drag | ||||
97 | // exits the window. | ||||
98 | pagerModel.refresh(); | ||||
99 | } | ||||
100 | } | ||||
101 | | ||||
92 | onWheel: { | 102 | onWheel: { | ||
93 | if (wheel.angleDelta.y > 0 || wheel.angleDelta.x > 0) { | 103 | if (wheel.angleDelta.y > 0 || wheel.angleDelta.x > 0) { | ||
94 | pagerModel.changePage((repeater.count + pagerModel.currentPage - 2) % repeater.count); | 104 | pagerModel.changePage((repeater.count + pagerModel.currentPage - 2) % repeater.count); | ||
95 | } else { | 105 | } else { | ||
96 | pagerModel.changePage(pagerModel.currentPage % repeater.count); | 106 | pagerModel.changePage(pagerModel.currentPage % repeater.count); | ||
97 | } | 107 | } | ||
98 | } | 108 | } | ||
99 | 109 | | |||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |