mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
ifix close button
This commit is contained in:
parent
f3193f5aef
commit
349de2f252
1 changed files with 47 additions and 45 deletions
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue