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

ose active window without c++

parent 18b4af0d
......@@ -43,7 +43,7 @@ Item {
target: tasksView
onContentYChanged: {
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 {
ScriptAction {
script: {
if (background.x != 0) {
tasksModel.requestClose(model.index);
tasksModel.requestClose(tasksModel.index(model.index, 0));
}
}
}
......
......@@ -36,6 +36,7 @@ FullScreenPanel {
property int overShoot: units.gridUnit * 2
property int tasksCount: tasksModel.count
property int currentTaskIndex: -1
property alias model: tasksModel
color: Qt.rgba(0, 0, 0, 0.8 * Math.min(
(Math.min(tasksView.contentY + tasksView.height, tasksView.height) / tasksView.height),
......
......@@ -145,8 +145,14 @@ PlasmaCore.ColorScope {
width: parent.width/3
anchors.right: parent.right
iconSource: "window-close"
enabled: plasmoid.nativeInterface.hasCloseableActiveWindow;
onClicked: plasmoid.nativeInterface.closeActiveWindow();
//FIXME:Qt.UserRole+9 is IsWindow Qt.UserRole+15 is IsClosable. We can't reach that enum from QML
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);
onPositionChanged: mainMouseArea.positionChanged(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