From a31733e2db5651e6d14743160b2534031f7c49b0 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:39:30 +0700 Subject: [PATCH] move scrolling animation to styled components --- .../ii/modules/common/widgets/StyledFlickable.qml | 9 +++++++++ .../ii/modules/common/widgets/StyledListView.qml | 9 +++++++++ .config/quickshell/ii/modules/sidebarLeft/AiChat.qml | 9 --------- .config/quickshell/ii/modules/sidebarLeft/Anime.qml | 9 --------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml index bde7bff9b..7fcf7be88 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledFlickable.qml @@ -23,4 +23,13 @@ Flickable { root.contentY = targetY; } } + + Behavior on contentY { + NumberAnimation { + id: scrollAnim + duration: Appearance.animation.scroll.duration + easing.type: Appearance.animation.scroll.type + easing.bezierCurve: Appearance.animation.scroll.bezierCurve + } + } } diff --git a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml index 61e6740fc..6a9cf258f 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledListView.qml @@ -41,6 +41,15 @@ ListView { } } + Behavior on contentY { + NumberAnimation { + id: scrollAnim + duration: Appearance.animation.scroll.duration + easing.type: Appearance.animation.scroll.type + easing.bezierCurve: Appearance.animation.scroll.bezierCurve + } + } + add: Transition { animations: [ Appearance?.animation.elementMove.numberAnimation.createObject(this, { diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index 9120a8f72..f3a1dae8f 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -299,15 +299,6 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) add: null // Prevent function calls from being janky - Behavior on contentY { - NumberAnimation { - id: scrollAnim - duration: Appearance.animation.scroll.duration - easing.type: Appearance.animation.scroll.type - easing.bezierCurve: Appearance.animation.scroll.bezierCurve - } - } - model: ScriptModel { values: Ai.messageIDs.filter(id => { const message = Ai.messageByID[id]; diff --git a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml index 07575ca36..68d4947b8 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/Anime.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/Anime.qml @@ -152,15 +152,6 @@ Item { } } - Behavior on contentY { - NumberAnimation { - id: scrollAnim - duration: Appearance.animation.scroll.duration - easing.type: Appearance.animation.scroll.type - easing.bezierCurve: Appearance.animation.scroll.bezierCurve - } - } - model: ScriptModel { values: { if(root.responses.length > booruResponseListView.lastResponseLength) {