From 8aac7a2b9c8589a247b52a3ff265f7f909fffca9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 1 Oct 2015 17:28:09 +0200 Subject: [PATCH] don't show the task manager if there are no tasks --- containments/taskpanel/package/contents/ui/TaskSwitcher.qml | 4 ++++ containments/taskpanel/package/contents/ui/main.qml | 1 + 2 files changed, 5 insertions(+) diff --git a/containments/taskpanel/package/contents/ui/TaskSwitcher.qml b/containments/taskpanel/package/contents/ui/TaskSwitcher.qml index bfbdf9c3..a9b8dc30 100644 --- a/containments/taskpanel/package/contents/ui/TaskSwitcher.qml +++ b/containments/taskpanel/package/contents/ui/TaskSwitcher.qml @@ -32,12 +32,16 @@ FullScreenPanel { height: Screen.height property int offset: 0 property int overShoot: units.gridUnit * 2 + property int tasksCount: filteredWindowModel.count color: Qt.rgba(0, 0, 0, 0.6 * Math.min( (Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height), ((tasksView.contentHeight - tasksView.contentY - tasksView.headerItem.height - tasksView.footerItem.height)/tasksView.height))) function show() { + if (filteredWindowModel.count == 0) { + return; + } if (!visible) { tasksView.contentY = -tasksView.headerItem.height; } diff --git a/containments/taskpanel/package/contents/ui/main.qml b/containments/taskpanel/package/contents/ui/main.qml index afea3e85..f30556c7 100644 --- a/containments/taskpanel/package/contents/ui/main.qml +++ b/containments/taskpanel/package/contents/ui/main.qml @@ -83,6 +83,7 @@ PlasmaCore.ColorScope { anchors.left: parent.left height: parent.height width: parent.width/3 + enabled: taskSwitcher.tasksCount > 0 iconSource: "applications-other" onClicked: taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show(); }