Commit 30b0c09f authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Makes delete activity dialog fully opaque when it is opened.

CCBUG: 288426
(cherry picked from commit 223aa40f)
parent 936fe896
......@@ -158,15 +158,18 @@ Item {
opacity: model["Current"] == true ? 0.4 : 1
enabled: opacity == 1
z: 800
property double oldOpacity: delegate.PathView.itemOpacity
onClicked: {
if (!deleteButtonParent.confirmationDialog) {
deleteButtonParent.confirmationDialog = confirmationDialogComponent.createObject(deleteButtonParent)
// always recreate the dialog because on a second launch it moves upper a little bit.
if (deleteButtonParent.confirmationDialog) {
deleteButtonParent.confirmationDialog.scale = 0
deleteButtonParent.confirmationDialog.destroy()
deleteButtonParent.confirmationDialog = null
}
if (deleteButtonParent.confirmationDialog.scale >= 1) {
deleteButtonParent.confirmationDialog.scale = 0
} else {
if (toggle) {
deleteButtonParent.confirmationDialog = confirmationDialogComponent.createObject(deleteButtonParent)
deleteButtonParent.confirmationDialog.scale = 1 / delegate.scale
// scale does not change dialog's width so we need to anchor the confirmationDialog's center manually.
......@@ -175,10 +178,20 @@ Item {
if (delegate.PathView.itemScale == 1) { // activity at PathView's center, not necessary the current activity.
deleteButtonParent.confirmationDialog.anchors.bottom = deleteButton.top
} else {
deleteButtonParent.confirmationDialog.y = deleteButton.y - (deleteButtonParent.confirmationDialog.height - deleteButton.height)* (1 / delegate.scale) / 2
deleteButtonParent.confirmationDialog.y = deleteButton.y - deleteButton.height / (3/2) * (1 / delegate.scale)
}
}
}
onCheckedChanged: {
// makes dialog and activity thumbnail fully opaque only when dialog is opened.
if (checked) {
oldOpacity = delegate.PathView.itemOpacity
delegate.PathView.itemOpacity = 1
} else {
delegate.PathView.itemOpacity = oldOpacity
}
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment