Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/Task.qml
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 31 | MouseArea { | |||
---|---|---|---|---|---|
116 | 116 | | |||
117 | onContainsMouseChanged: { | 117 | onContainsMouseChanged: { | ||
118 | if (containsMouse) { | 118 | if (containsMouse) { | ||
119 | if (inPopup) { | 119 | if (inPopup) { | ||
120 | forceActiveFocus(); | 120 | forceActiveFocus(); | ||
121 | } | 121 | } | ||
122 | } else { | 122 | } else { | ||
123 | pressed = false; | 123 | pressed = false; | ||
124 | tasks.taskMouseLeft(itemIndex); | ||||
124 | } | 125 | } | ||
125 | 126 | | |||
126 | if (model.IsWindow === true) { | 127 | if (model.IsWindow === true) { | ||
127 | tasks.windowsHovered(model.LegacyWinIdList, containsMouse); | 128 | tasksModel.makeModelIndex(index); | ||
128 | } | 129 | } | ||
129 | 130 | | |||
130 | } | 131 | } | ||
131 | 132 | | |||
133 | function showToolTip() { | ||||
134 | if (containsMouse) { | ||||
135 | toolTipDelegate.parentTask = task; | ||||
136 | toolTipDelegate.parentIndex = itemIndex; | ||||
137 | | ||||
138 | toolTipDelegate.appName = Qt.binding(function() { | ||||
139 | return model.AppName; | ||||
140 | }); | ||||
141 | toolTipDelegate.pidParent = Qt.binding(function() { | ||||
142 | return model.AppPid; | ||||
143 | }); | ||||
144 | toolTipDelegate.windows = Qt.binding(function() { | ||||
145 | return model.LegacyWinIdList; | ||||
146 | }); | ||||
147 | toolTipDelegate.isGroup = Qt.binding(function() { | ||||
148 | return model.IsGroupParent == true; | ||||
149 | }); | ||||
150 | toolTipDelegate.icon = Qt.binding(function() { | ||||
151 | return model.decoration; | ||||
152 | }); | ||||
153 | toolTipDelegate.launcherUrl = Qt.binding(function() { | ||||
154 | return model.LauncherUrlWithoutIcon; | ||||
155 | }); | ||||
156 | toolTipDelegate.isLauncher = Qt.binding(function() { | ||||
157 | return model.IsLauncher == true; | ||||
158 | }); | ||||
159 | toolTipDelegate.isMinimizedParent = Qt.binding(function() { | ||||
160 | return model.IsMinimized == true; | ||||
161 | }); | ||||
162 | toolTipDelegate.displayParent = Qt.binding(function() { | ||||
163 | return model.display; | ||||
164 | }); | ||||
165 | toolTipDelegate.genericName = Qt.binding(function() { | ||||
166 | return model.GenericName; | ||||
167 | }); | ||||
168 | toolTipDelegate.virtualDesktopParent = Qt.binding(function() { | ||||
169 | return model.VirtualDesktop != undefined ? model.VirtualDesktop : 0; | ||||
170 | }); | ||||
171 | toolTipDelegate.isOnAllVirtualDesktopsParent = Qt.binding(function() { | ||||
172 | return model.IsOnAllVirtualDesktops == true; | ||||
173 | }); | ||||
174 | toolTipDelegate.activitiesParent = Qt.binding(function() { | ||||
175 | return model.Activities; | ||||
176 | }); | ||||
177 | | ||||
178 | toolTipDelegate.smartLauncherCountVisible = Qt.binding(function() { | ||||
179 | return plasmoid.configuration.smartLaunchersEnabled && task.smartLauncherItem && task.smartLauncherItem.countVisible; | ||||
180 | }); | ||||
181 | toolTipDelegate.smartLauncherCount = Qt.binding(function() { | ||||
182 | return toolTipDelegate.smartLauncherCountVisible ? task.smartLauncherItem.count : 0; | ||||
183 | }); | ||||
184 | } | ||||
185 | } | ||||
186 | | ||||
132 | onPressed: { | 187 | onPressed: { | ||
133 | if (mouse.button == Qt.LeftButton || mouse.button == Qt.MidButton || mouse.button === Qt.BackButton || mouse.button === Qt.ForwardButton) { | 188 | if (mouse.button == Qt.LeftButton || mouse.button == Qt.MidButton || mouse.button === Qt.BackButton || mouse.button === Qt.ForwardButton) { | ||
134 | pressed = true; | 189 | pressed = true; | ||
135 | pressX = mouse.x; | 190 | pressX = mouse.x; | ||
136 | pressY = mouse.y; | 191 | pressY = mouse.y; | ||
137 | } else if (mouse.button == Qt.RightButton) { | 192 | } else if (mouse.button == Qt.RightButton) { | ||
138 | // When we're a launcher, there's no window controls, so we can show all | 193 | // When we're a launcher, there's no window controls, so we can show all | ||
139 | // places without the menu getting super huge. | 194 | // places without the menu getting super huge. | ||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 354 | PlasmaCore.FrameSvgItem { | |||
315 | PlasmaCore.ToolTipArea { | 370 | PlasmaCore.ToolTipArea { | ||
316 | id: toolTipArea | 371 | id: toolTipArea | ||
317 | 372 | | |||
318 | anchors.fill: parent | 373 | anchors.fill: parent | ||
319 | location: plasmoid.location | 374 | location: plasmoid.location | ||
320 | 375 | | |||
321 | active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips | 376 | active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips | ||
322 | interactive: true | 377 | interactive: true | ||
323 | 378 | autoShowHide: false | |||
324 | mainItem: toolTipDelegate | 379 | mainItem: toolTipDelegate | ||
325 | 380 | | |||
326 | onContainsMouseChanged: { | 381 | onToolTipWindowContainsMouseChanged: { | ||
327 | if (containsMouse) { | 382 | if (toolTipWindowContainsMouse) { | ||
328 | toolTipDelegate.parentTask = task; | 383 | tasks.taskMouseEntered(itemIndex); | ||
329 | toolTipDelegate.parentIndex = itemIndex; | 384 | } else { | ||
330 | 385 | tasks.taskMouseLeft(itemIndex); | |||
331 | toolTipDelegate.appName = Qt.binding(function() { | | |||
332 | return model.AppName; | | |||
333 | }); | | |||
334 | toolTipDelegate.pidParent = Qt.binding(function() { | | |||
335 | return model.AppPid; | | |||
336 | }); | | |||
337 | toolTipDelegate.windows = Qt.binding(function() { | | |||
338 | return model.LegacyWinIdList; | | |||
339 | }); | | |||
340 | toolTipDelegate.isGroup = Qt.binding(function() { | | |||
341 | return model.IsGroupParent == true; | | |||
342 | }); | | |||
343 | toolTipDelegate.icon = Qt.binding(function() { | | |||
344 | return model.decoration; | | |||
345 | }); | | |||
346 | toolTipDelegate.launcherUrl = Qt.binding(function() { | | |||
347 | return model.LauncherUrlWithoutIcon; | | |||
348 | }); | | |||
349 | toolTipDelegate.isLauncher = Qt.binding(function() { | | |||
350 | return model.IsLauncher == true; | | |||
351 | }); | | |||
352 | toolTipDelegate.isMinimizedParent = Qt.binding(function() { | | |||
353 | return model.IsMinimized == true; | | |||
354 | }); | | |||
355 | toolTipDelegate.displayParent = Qt.binding(function() { | | |||
356 | return model.display; | | |||
357 | }); | | |||
358 | toolTipDelegate.genericName = Qt.binding(function() { | | |||
359 | return model.GenericName; | | |||
360 | }); | | |||
361 | toolTipDelegate.virtualDesktopParent = Qt.binding(function() { | | |||
362 | return model.VirtualDesktop != undefined ? model.VirtualDesktop : 0; | | |||
363 | }); | | |||
364 | toolTipDelegate.isOnAllVirtualDesktopsParent = Qt.binding(function() { | | |||
365 | return model.IsOnAllVirtualDesktops == true; | | |||
366 | }); | | |||
367 | toolTipDelegate.activitiesParent = Qt.binding(function() { | | |||
368 | return model.Activities; | | |||
369 | }); | | |||
370 | | ||||
371 | toolTipDelegate.smartLauncherCountVisible = Qt.binding(function() { | | |||
372 | return plasmoid.configuration.smartLaunchersEnabled && task.smartLauncherItem && task.smartLauncherItem.countVisible; | | |||
373 | }); | | |||
374 | toolTipDelegate.smartLauncherCount = Qt.binding(function() { | | |||
375 | return toolTipDelegate.smartLauncherCountVisible ? task.smartLauncherItem.count : 0; | | |||
376 | }); | | |||
377 | } | 386 | } | ||
378 | } | 387 | } | ||
379 | } | 388 | } | ||
380 | } | 389 | } | ||
381 | 390 | | |||
382 | Loader { | 391 | Loader { | ||
383 | anchors.fill: frame | 392 | anchors.fill: frame | ||
384 | asynchronous: true | 393 | asynchronous: true | ||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |