Replace use of magic numbers for animation durations in copy share link button with constants defined in Style.qml

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-05-10 12:38:27 +08:00
parent 4e12bbf3e4
commit 191d8350c1
2 changed files with 7 additions and 3 deletions

View file

@ -881,11 +881,11 @@ Page {
onClicked: copyShareLink()
Behavior on bgColor {
ColorAnimation { duration: 200 }
ColorAnimation { duration: Style.shortAnimationDuration }
}
Behavior on bgHoverOpacity {
NumberAnimation { duration: 200 }
NumberAnimation { duration: Style.shortAnimationDuration }
}
TextEdit {
@ -895,7 +895,7 @@ Page {
Timer {
id: shareLinkCopyTimer
interval: 3000
interval: Style.veryLongAnimationDuration
onTriggered: copyShareLinkButton.shareLinkCopied = false
}
}

View file

@ -147,6 +147,10 @@ QtObject {
readonly property int trayWindowMenuEntriesMargin: 6
// animation durations
readonly property int shortAnimationDuration: 200
readonly property int veryLongAnimationDuration: 3000
function variableSize(size) {
return size * (1 + Math.min(pixelSize / 100, 1));
}