Added animation settings

This commit is contained in:
Digital Artifex
2026-08-25 19:22:39 -04:00
parent c8209b723a
commit 6bea9b32df
19 changed files with 870 additions and 79 deletions
+141 -9
View File
@@ -1,3 +1,22 @@
/*
* Komplex Wallpaper Engine
* Copyright (C) 2026 @DigitalArtifex
* https://digitalartifex.dev - https://github.com/DigitalArtifex
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
import QtCore
import QtQuick
import QtQuick.Controls 2.0
import QtQuick.Layouts
@@ -20,6 +39,10 @@ Item
imagesModel.state === FeaturedImagesModel.Loading ||
videosModel.state === FeaturedVideosModel.Loading;
property bool error: packsModel.state === NewestPacksModel.Error ||
imagesModel.state === FeaturedImagesModel.Error ||
videosModel.state === FeaturedVideosModel.Error;
onWidthChanged: () =>
{
packsModel.resultsPerPage = resultsPerRow
@@ -405,6 +428,15 @@ Item
visible: opacity > 0
opacity: 1
Behavior on opacity
{
NumberAnimation
{
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
Rectangle
@@ -426,7 +458,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
@@ -442,7 +475,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
@@ -458,7 +492,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
@@ -467,7 +502,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
@@ -486,7 +522,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
@@ -508,7 +545,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
@@ -530,7 +568,8 @@ Item
{
NumberAnimation
{
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
@@ -538,6 +577,25 @@ Item
}
}
ErrorView
{
id: errorView
anchors.fill: parent
opacity: 0
visible: opacity > 0.01
manager: downloadManager
Behavior on opacity
{
NumberAnimation
{
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
}
}
}
Item
{
id: featuredLoaderItem
@@ -577,6 +635,41 @@ Item
target: popupContainer
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
},
State
{
name: "error"
when: homePageRoot.error
PropertyChanges
{
target: loadingAnimation
opacity: 1
}
PropertyChanges
{
target: pageArea
opacity: 0
}
PropertyChanges
{
target: popupContainer
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 1
}
},
State
{
@@ -594,6 +687,18 @@ Item
target: pageArea
opacity: 1
}
PropertyChanges
{
target: errorView
opacity: 0
}
PropertyChanges
{
target: popupContainer
opacity: 0
}
},
State
{
@@ -611,6 +716,18 @@ Item
target: loadingAnimation
opacity: 0
}
PropertyChanges
{
target: errorView
opacity: 0
}
PropertyChanges
{
target: popupContainer
opacity: 1
}
}
]
@@ -623,13 +740,15 @@ Item
NumberAnimation
{
target: loadingAnimation
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
property: "opacity";
}
NumberAnimation
{
target: pageArea
duration: 250
duration: settings.animationsEnabled ?
settings.normalAnimationDuration : 0
property: "opacity";
}
}
@@ -725,4 +844,17 @@ Item
pageArea.opacity = 1
homePageRoot.popup = false
}
Settings
{
id: settings
property bool animationsEnabled: true
//ms length of page change
property int pageChangeAnimationDuration: 250
property int pageFadeAnimationDuration: 250
property int slowAnimationDuration: 750
property int normalAnimationDuration: 250
property int fastAnimationDuration: 125
}
}