mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
ose active window without c++
This commit is contained in:
parent
18b4af0def
commit
0f38293010
3 changed files with 11 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue