mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 16:54:46 +00:00
some layout fixes
This commit is contained in:
parent
adc4603274
commit
5179b04a68
2 changed files with 27 additions and 10 deletions
|
|
@ -27,7 +27,7 @@ MouseArea {
|
||||||
id: notificationItem
|
id: notificationItem
|
||||||
|
|
||||||
|
|
||||||
height: units.gridUnit * (expanded ? (actionsLayout.visible ? 6 : 4) : 2) + background.margins.top + background.margins.bottom
|
height: Math.max(summaryText.height, icon.height) + background.margins.top + background.margins.bottom + (expanded ? actionsLayout.height : 0)
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.bottomMargin: 10
|
anchors.bottomMargin: 10
|
||||||
drag.axis: Drag.XAxis
|
drag.axis: Drag.XAxis
|
||||||
|
|
@ -38,11 +38,17 @@ MouseArea {
|
||||||
property var actions: model.actions
|
property var actions: model.actions
|
||||||
|
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
SpringAnimation { spring: 2; damping: 0.2 }
|
NumberAnimation {
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
duration: units.longDuration
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
SpringAnimation { spring: 5; damping: 0.3 }
|
NumberAnimation {
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
duration: units.longDuration
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
|
@ -50,9 +56,11 @@ MouseArea {
|
||||||
if (x > width / 4 || x < width / -4) {
|
if (x > width / 4 || x < width / -4) {
|
||||||
//if there is an action, execute the first when swiping left
|
//if there is an action, execute the first when swiping left
|
||||||
if (x < 0 && actions) {
|
if (x < 0 && actions) {
|
||||||
var action = actions.get(0)
|
var action = actions.get(0);
|
||||||
|
if (action) {
|
||||||
root.executeAction(source, action.id)
|
root.executeAction(source, action.id)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
notificationsModel.remove(index);
|
notificationsModel.remove(index);
|
||||||
} else {
|
} else {
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,8 @@ Item {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "x"
|
properties: "x"
|
||||||
from: notificationView.width
|
from: notificationView.width
|
||||||
duration: 100
|
duration: units.shortDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,19 +166,27 @@ Item {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "x"
|
properties: "x"
|
||||||
to: notificationView.width
|
to: notificationView.width
|
||||||
duration: 500
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "opacity"
|
properties: "opacity"
|
||||||
to: 0
|
to: 0
|
||||||
duration: 500
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeDisplaced: Transition {
|
removeDisplaced: Transition {
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PauseAnimation { duration: 600 }
|
PauseAnimation {
|
||||||
NumberAnimation { properties: "x,y"; duration: 100 }
|
duration: units.longDuration
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "x,y"
|
||||||
|
duration: units.shortDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue