From 191d8350c11ea1a2b8adaa296b3b9ddb2a01b4ce Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 10 May 2023 12:38:27 +0800 Subject: [PATCH] Replace use of magic numbers for animation durations in copy share link button with constants defined in Style.qml Signed-off-by: Claudio Cambra --- src/gui/filedetails/ShareDetailsPage.qml | 6 +++--- theme/Style/Style.qml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/filedetails/ShareDetailsPage.qml b/src/gui/filedetails/ShareDetailsPage.qml index 6f6ba36b9..17bd184bc 100644 --- a/src/gui/filedetails/ShareDetailsPage.qml +++ b/src/gui/filedetails/ShareDetailsPage.qml @@ -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 } } diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index ba90ed2fc..21bfeb460 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -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)); }