Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/Task.qml
Show All 25 Lines | |||||
26 | import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet | 26 | import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet | ||
27 | 27 | | |||
28 | import "../code/layout.js" as LayoutManager | 28 | import "../code/layout.js" as LayoutManager | ||
29 | import "../code/tools.js" as TaskTools | 29 | import "../code/tools.js" as TaskTools | ||
30 | 30 | | |||
31 | MouseArea { | 31 | MouseArea { | ||
32 | id: task | 32 | id: task | ||
33 | 33 | | |||
34 | width: groupDialog.mainItem.width | 34 | width: groupDialog.contentWidth | ||
35 | height: Math.max(theme.mSize(theme.defaultFont).height, units.iconSizes.medium) + LayoutManager.verticalMargins() | 35 | height: Math.max(theme.mSize(theme.defaultFont).height, units.iconSizes.medium) + LayoutManager.verticalMargins() | ||
36 | 36 | | |||
37 | visible: false | 37 | visible: false | ||
38 | 38 | | |||
39 | LayoutMirroring.enabled: (Qt.application.layoutDirection == Qt.RightToLeft) | 39 | LayoutMirroring.enabled: (Qt.application.layoutDirection == Qt.RightToLeft) | ||
40 | LayoutMirroring.childrenInherit: (Qt.application.layoutDirection == Qt.RightToLeft) | 40 | LayoutMirroring.childrenInherit: (Qt.application.layoutDirection == Qt.RightToLeft) | ||
41 | 41 | | |||
42 | readonly property var m: model | 42 | readonly property var m: model | ||
43 | 43 | | |||
44 | readonly property int pid: model.AppPid | 44 | readonly property int pid: model.AppPid | ||
45 | readonly property string appName: model.AppName | 45 | readonly property string appName: model.AppName | ||
46 | property int itemIndex: index | 46 | property int itemIndex: index | ||
47 | property bool inPopup: false | 47 | property bool inPopup: false | ||
48 | property bool isWindow: model.IsWindow === true | 48 | property bool isWindow: model.IsWindow === true | ||
49 | property int childCount: model.ChildCount != undefined ? model.ChildCount : 0 | 49 | property int childCount: model.ChildCount != undefined ? model.ChildCount : 0 | ||
50 | property int previousChildCount: 0 | 50 | property int previousChildCount: 0 | ||
51 | property alias textWidth: label.implicitWidth | 51 | property alias labelText: label.text | ||
52 | property bool pressed: false | 52 | property bool pressed: false | ||
53 | property int pressX: -1 | 53 | property int pressX: -1 | ||
54 | property int pressY: -1 | 54 | property int pressY: -1 | ||
55 | property QtObject contextMenu: null | 55 | property QtObject contextMenu: null | ||
56 | property int wheelDelta: 0 | 56 | property int wheelDelta: 0 | ||
57 | readonly property bool smartLauncherEnabled: plasmoid.configuration.smartLaunchersEnabled && !inPopup && model.IsStartup !== true | 57 | readonly property bool smartLauncherEnabled: plasmoid.configuration.smartLaunchersEnabled && !inPopup && model.IsStartup !== true | ||
58 | property QtObject smartLauncherItem: null | 58 | property QtObject smartLauncherItem: null | ||
59 | 59 | | |||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 154 | if (pressX != -1 && mouse.buttons == Qt.LeftButton && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) { | |||
158 | pressX = -1; | 158 | pressX = -1; | ||
159 | pressY = -1; | 159 | pressY = -1; | ||
160 | 160 | | |||
161 | return; | 161 | return; | ||
162 | } | 162 | } | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | onWheel: { | 165 | onWheel: { | ||
166 | if (plasmoid.configuration.wheelEnabled) { | 166 | if (plasmoid.configuration.wheelEnabled && (!inPopup || !groupDialog.overflowing)) { | ||
167 | wheelDelta = TaskTools.wheelActivateNextPrevTask(task, wheelDelta, wheel.angleDelta.y); | 167 | wheelDelta = TaskTools.wheelActivateNextPrevTask(task, wheelDelta, wheel.angleDelta.y); | ||
168 | } else { | 168 | } else { | ||
169 | wheel.accepted = false; | 169 | wheel.accepted = false; | ||
170 | } | 170 | } | ||
171 | } | 171 | } | ||
172 | 172 | | |||
173 | onSmartLauncherEnabledChanged: { | 173 | onSmartLauncherEnabledChanged: { | ||
174 | if (smartLauncherEnabled && !smartLauncherItem) { | 174 | if (smartLauncherEnabled && !smartLauncherItem) { | ||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |