Procházet zdrojové kódy

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>
Claudio Cambra před 2 roky
rodič
revize
191d8350c1

+ 3 - 3
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
             }
         }

+ 4 - 0
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));
     }