Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/main.qml
Show All 30 Lines | |||||
31 | 31 | | |||
32 | Item { | 32 | Item { | ||
33 | id: tasks | 33 | id: tasks | ||
34 | 34 | | |||
35 | anchors.fill: parent | 35 | anchors.fill: parent | ||
36 | 36 | | |||
37 | property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) | 37 | property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical) | ||
38 | property bool iconsOnly: (plasmoid.pluginName == "org.kde.plasma.icontasks") | 38 | property bool iconsOnly: (plasmoid.pluginName == "org.kde.plasma.icontasks") | ||
39 | 39 | property QtObject currentToolTipTask: null; | |||
40 | property QtObject futureToolTipTask: null; | ||||
40 | property QtObject contextMenuComponent: Qt.createComponent("ContextMenu.qml"); | 41 | property QtObject contextMenuComponent: Qt.createComponent("ContextMenu.qml"); | ||
41 | 42 | | |||
42 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | 43 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | ||
43 | 44 | | |||
44 | Plasmoid.onUserConfiguringChanged: { | 45 | Plasmoid.onUserConfiguringChanged: { | ||
45 | if (plasmoid.userConfiguring) { | 46 | if (plasmoid.userConfiguring) { | ||
46 | groupDialog.visible = false; | 47 | groupDialog.visible = false; | ||
47 | } | 48 | } | ||
▲ Show 20 Lines • Show All 422 Lines • ▼ Show 20 Line(s) | 469 | function createContextMenu(rootTask, modelIndex, args) { | |||
470 | initialArgs.visualParent = rootTask; | 471 | initialArgs.visualParent = rootTask; | ||
471 | initialArgs.modelIndex = modelIndex; | 472 | initialArgs.modelIndex = modelIndex; | ||
472 | initialArgs.mpris2Source = mpris2Source; | 473 | initialArgs.mpris2Source = mpris2Source; | ||
473 | initialArgs.backend = backend; | 474 | initialArgs.backend = backend; | ||
474 | 475 | | |||
475 | return tasks.contextMenuComponent.createObject(rootTask, initialArgs); | 476 | return tasks.contextMenuComponent.createObject(rootTask, initialArgs); | ||
476 | } | 477 | } | ||
477 | 478 | | |||
479 | Timer { | ||||
480 | id: toolTipHideTimer | ||||
481 | | ||||
482 | interval: 300 | ||||
483 | repeat: false | ||||
484 | | ||||
485 | onTriggered: { | ||||
486 | currentToolTipTask = futureToolTipTask; | ||||
487 | currentToolTipTask.showToolTip(); | ||||
488 | } | ||||
489 | } | ||||
490 | | ||||
491 | Timer { | ||||
492 | id: ToolTipHideTimer | ||||
493 | | ||||
494 | interval: 300 | ||||
495 | repeat: false | ||||
496 | | ||||
497 | onTriggered: { | ||||
498 | currentToolTipTask.hideToolTip(); | ||||
499 | currentToolTipTask = null; | ||||
500 | } | ||||
501 | } | ||||
502 | | ||||
503 | function taskMouseEntered(itemIndex) { | ||||
504 | var task = taskRepeater.itemAt(itemIndex); | ||||
505 | toolTipHideTimer.stop(); | ||||
506 | toolTipShowTimer.stop() | ||||
507 | | ||||
508 | if(task != currentToolTipTask) { | ||||
509 | futureToolTipTask = task; | ||||
510 | toolTipShowTimer.start(); | ||||
511 | } | ||||
512 | } | ||||
513 | | ||||
478 | Component.onCompleted: { | 514 | Component.onCompleted: { | ||
479 | tasks.requestLayout.connect(layoutTimer.restart); | 515 | tasks.requestLayout.connect(layoutTimer.restart); | ||
480 | tasks.requestLayout.connect(iconGeometryTimer.restart); | 516 | tasks.requestLayout.connect(iconGeometryTimer.restart); | ||
481 | tasks.windowsHovered.connect(backend.windowsHovered); | 517 | tasks.windowsHovered.connect(backend.windowsHovered); | ||
482 | tasks.presentWindows.connect(backend.presentWindows); | 518 | tasks.presentWindows.connect(backend.presentWindows); | ||
483 | dragHelper.dropped.connect(resetDragSource); | 519 | dragHelper.dropped.connect(resetDragSource); | ||
484 | } | 520 | } | ||
485 | } | 521 | } |