mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
close applications with swipe
This commit is contained in:
parent
4b71d0b0d8
commit
2d822299f1
1 changed files with 39 additions and 21 deletions
|
|
@ -28,29 +28,47 @@ WindowWrapper {
|
||||||
compositorRoot.layers.windows.contentX = x;
|
compositorRoot.layers.windows.contentX = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea {
|
Behavior on y {
|
||||||
z: 99
|
enabled: !mouse.active
|
||||||
anchors.fill: parent
|
SequentialAnimation {
|
||||||
enabled: compositorRoot.layers.windows.switchMode
|
NumberAnimation {
|
||||||
onClicked: {
|
easing.type: "InOutQuad"
|
||||||
compositorRoot.currentWindow = window
|
duration: units.longDuration
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
}
|
||||||
visible: compositorRoot.layers.windows.switchMode
|
ScriptAction {
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
script: {
|
||||||
width: units.iconSizes.smallMedium
|
if (window.opacity < 0.3) {
|
||||||
height: width
|
window.close();
|
||||||
source: "window-close"
|
}
|
||||||
|
}
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: window.close()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
opacity: 1 - (Math.abs(y) / height)
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouse
|
||||||
|
z: 99
|
||||||
|
anchors.fill: parent
|
||||||
|
enabled: compositorRoot.layers.windows.switchMode
|
||||||
|
property bool active
|
||||||
|
onPressed: {
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
compositorRoot.currentWindow = window
|
||||||
|
}
|
||||||
|
onReleased: {
|
||||||
|
active = false;
|
||||||
|
if (window.opacity < 0.3) {
|
||||||
|
window.y = (window.y > 0 ? +1 : -1) * window.height;
|
||||||
|
} else {
|
||||||
|
window.y = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drag {
|
||||||
|
axis: Drag.YAxis
|
||||||
|
target: window
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue