ifix close button

This commit is contained in:
Marco Martin 2020-08-20 16:55:14 +02:00
parent f3193f5aef
commit 349de2f252

View file

@ -93,6 +93,31 @@ Item {
radius: units.smallSpacing radius: units.smallSpacing
color: theme.backgroundColor color: theme.backgroundColor
opacity: 1 * (1-Math.abs(x)/width) opacity: 1 * (1-Math.abs(x)/width)
MouseArea {
anchors.fill: parent
drag {
target: background
axis: Drag.XAxis
}
onPressed: delegate.z = 10;
onClicked: {
window.setSingleActiveWindow(model.index, delegate);
if (!model.IsMinimized) {
window.visible = false;
}
}
onReleased: {
delegate.z = 0;
if (Math.abs(background.x) > background.width/2) {
slideAnim.to = background.x > 0 ? background.width*2 : -background.width*2;
slideAnim.running = true;
} else {
slideAnim.to = 0;
slideAnim.running = true;
}
}
ColumnLayout { ColumnLayout {
anchors { anchors {
fill: parent fill: parent
@ -138,29 +163,6 @@ Item {
} }
} }
} }
MouseArea {
anchors.fill: parent
drag {
target: background
axis: Drag.XAxis
}
onPressed: delegate.z = 10;
onClicked: {
window.setSingleActiveWindow(model.index, delegate);
if (!model.IsMinimized) {
window.visible = false;
}
}
onReleased: {
delegate.z = 0;
if (Math.abs(background.x) > background.width/2) {
slideAnim.to = background.x > 0 ? background.width*2 : -background.width*2;
slideAnim.running = true;
} else {
slideAnim.to = 0;
slideAnim.running = true;
}
}
} }
} }
} }