Commit 0f382930 authored by Marco Martin's avatar Marco Martin

ose active window without c++

parent 18b4af0d
...@@ -43,7 +43,7 @@ Item { ...@@ -43,7 +43,7 @@ Item {
target: tasksView target: tasksView
onContentYChanged: { onContentYChanged: {
var pos = delegate.mapToItem(tasksView, 0, 0); var pos = delegate.mapToItem(tasksView, 0, 0);
tasksModel.requestPublishDelegateGeometry(model.index, Qt.rect(pos.x, pos.y, delegate.width, delegate.height)); tasksModel.requestPublishDelegateGeometry(tasksModel.index(model.index, 0), Qt.rect(pos.x, pos.y, delegate.width, delegate.height));
} }
} }
...@@ -66,7 +66,7 @@ Item { ...@@ -66,7 +66,7 @@ Item {
ScriptAction { ScriptAction {
script: { script: {
if (background.x != 0) { if (background.x != 0) {
tasksModel.requestClose(model.index); tasksModel.requestClose(tasksModel.index(model.index, 0));
} }
} }
} }
......
...@@ -36,6 +36,7 @@ FullScreenPanel { ...@@ -36,6 +36,7 @@ FullScreenPanel {
property int overShoot: units.gridUnit * 2 property int overShoot: units.gridUnit * 2
property int tasksCount: tasksModel.count property int tasksCount: tasksModel.count
property int currentTaskIndex: -1 property int currentTaskIndex: -1
property alias model: tasksModel
color: Qt.rgba(0, 0, 0, 0.8 * Math.min( color: Qt.rgba(0, 0, 0, 0.8 * Math.min(
(Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height), (Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height),
......
...@@ -145,8 +145,14 @@ PlasmaCore.ColorScope { ...@@ -145,8 +145,14 @@ PlasmaCore.ColorScope {
width: parent.width/3 width: parent.width/3
anchors.right: parent.right anchors.right: parent.right
iconSource: "window-close" iconSource: "window-close"
enabled: plasmoid.nativeInterface.hasCloseableActiveWindow; //FIXME:Qt.UserRole+9 is IsWindow Qt.UserRole+15 is IsClosable. We can't reach that enum from QML
onClicked: plasmoid.nativeInterface.closeActiveWindow(); enabled: taskSwitcher.model ? (taskSwitcher.model.data(taskSwitcher.model.activeTask, Qt.UserRole+9) === true && taskSwitcher.model.data(taskSwitcher.model.activeTask, Qt.UserRole+15) === true) : false
onClicked: {
var index = taskSwitcher.model.activeTask;
if (index) {
taskSwitcher.model.requestClose(index);
}
}
onPressed: mainMouseArea.managePressed(mouse); onPressed: mainMouseArea.managePressed(mouse);
onPositionChanged: mainMouseArea.positionChanged(mouse); onPositionChanged: mainMouseArea.positionChanged(mouse);
onReleased: mainMouseArea.released(mouse); onReleased: mainMouseArea.released(mouse);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment