mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 22:33:08 +00:00
don't show the task manager if there are no tasks
This commit is contained in:
parent
6e03fc1e1e
commit
8aac7a2b9c
2 changed files with 5 additions and 0 deletions
|
|
@ -32,12 +32,16 @@ FullScreenPanel {
|
||||||
height: Screen.height
|
height: Screen.height
|
||||||
property int offset: 0
|
property int offset: 0
|
||||||
property int overShoot: units.gridUnit * 2
|
property int overShoot: units.gridUnit * 2
|
||||||
|
property int tasksCount: filteredWindowModel.count
|
||||||
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.6 * Math.min(
|
color: Qt.rgba(0, 0, 0, 0.6 * Math.min(
|
||||||
(Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height),
|
(Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height),
|
||||||
((tasksView.contentHeight - tasksView.contentY - tasksView.headerItem.height - tasksView.footerItem.height)/tasksView.height)))
|
((tasksView.contentHeight - tasksView.contentY - tasksView.headerItem.height - tasksView.footerItem.height)/tasksView.height)))
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
|
if (filteredWindowModel.count == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
tasksView.contentY = -tasksView.headerItem.height;
|
tasksView.contentY = -tasksView.headerItem.height;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ PlasmaCore.ColorScope {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width/3
|
width: parent.width/3
|
||||||
|
enabled: taskSwitcher.tasksCount > 0
|
||||||
iconSource: "applications-other"
|
iconSource: "applications-other"
|
||||||
onClicked: taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show();
|
onClicked: taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue