mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +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
|
||||
|
||||
|
||||
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
|
||||
anchors.bottomMargin: 10
|
||||
drag.axis: Drag.XAxis
|
||||
|
|
@ -38,11 +38,17 @@ MouseArea {
|
|||
property var actions: model.actions
|
||||
|
||||
Behavior on x {
|
||||
SpringAnimation { spring: 2; damping: 0.2 }
|
||||
NumberAnimation {
|
||||
easing.type: Easing.InOutQuad
|
||||
duration: units.longDuration
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on height {
|
||||
SpringAnimation { spring: 5; damping: 0.3 }
|
||||
NumberAnimation {
|
||||
easing.type: Easing.InOutQuad
|
||||
duration: units.longDuration
|
||||
}
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
|
|
@ -50,8 +56,10 @@ MouseArea {
|
|||
if (x > width / 4 || x < width / -4) {
|
||||
//if there is an action, execute the first when swiping left
|
||||
if (x < 0 && actions) {
|
||||
var action = actions.get(0)
|
||||
root.executeAction(source, action.id)
|
||||
var action = actions.get(0);
|
||||
if (action) {
|
||||
root.executeAction(source, action.id)
|
||||
}
|
||||
}
|
||||
notificationsModel.remove(index);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,8 @@ Item {
|
|||
NumberAnimation {
|
||||
properties: "x"
|
||||
from: notificationView.width
|
||||
duration: 100
|
||||
duration: units.shortDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -165,19 +166,27 @@ Item {
|
|||
NumberAnimation {
|
||||
properties: "x"
|
||||
to: notificationView.width
|
||||
duration: 500
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
properties: "opacity"
|
||||
to: 0
|
||||
duration: 500
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
removeDisplaced: Transition {
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 600 }
|
||||
NumberAnimation { properties: "x,y"; duration: 100 }
|
||||
PauseAnimation {
|
||||
duration: units.longDuration
|
||||
}
|
||||
NumberAnimation {
|
||||
properties: "x,y"
|
||||
duration: units.shortDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue