New setting to disable all UI animations

This commit is contained in:
ItsLemmy
2025-09-27 16:12:28 -04:00
parent 2112f675c0
commit 8b89e95b13
5 changed files with 38 additions and 19 deletions
+4
View File
@@ -31,6 +31,10 @@
"animation-speed": {
"label": "Animation speed",
"description": "Adjust global animation speed."
},
"animation-disable": {
"label": "Disable UI Animations",
"description": "Disable all animations for a faster, more responsive experience."
}
},
"screen-corners": {
+3 -2
View File
@@ -1,5 +1,5 @@
{
"settingsVersion": 10,
"settingsVersion": 11,
"bar": {
"position": "top",
"backgroundOpacity": 1,
@@ -67,7 +67,8 @@
"forceBlackScreenCorners": false,
"radiusRatio": 1,
"screenRadiusRatio": 1,
"animationSpeed": 1
"animationSpeed": 1,
"animationDisabled": false
},
"location": {
"name": "Tokyo",
+3 -2
View File
@@ -54,7 +54,7 @@ Singleton {
// Then it should be commented out again, regular users don't need to generate
// default settings on every start
// TODO: automate this someday!
//generateDefaultSettings()
// generateDefaultSettings()
// Patch-in the local default, resolved to user's home
adapter.general.avatarImage = defaultAvatar
@@ -114,7 +114,7 @@ Singleton {
JsonAdapter {
id: adapter
property int settingsVersion: 10
property int settingsVersion: 11
// bar
property JsonObject bar: JsonObject {
@@ -175,6 +175,7 @@ Singleton {
property real radiusRatio: 1.0
property real screenRadiusRatio: 1.0
property real animationSpeed: 1.0
property bool animationDisabled: false
}
// location
+4 -4
View File
@@ -60,10 +60,10 @@ Singleton {
property real opacityFull: 1.0
// Animation duration (ms)
property int animationFast: Math.round(150 / Settings.data.general.animationSpeed)
property int animationNormal: Math.round(300 / Settings.data.general.animationSpeed)
property int animationSlow: Math.round(450 / Settings.data.general.animationSpeed)
property int animationSlowest: Math.round(750 / Settings.data.general.animationSpeed)
property int animationFast: Settings.data.general.animationDisabled ? 0 : Math.round(150 / Settings.data.general.animationSpeed)
property int animationNormal: Settings.data.general.animationDisabled ? 0 : Math.round(300 / Settings.data.general.animationSpeed)
property int animationSlow: Settings.data.general.animationDisabled ? 0 : Math.round(450 / Settings.data.general.animationSpeed)
property int animationSlowest: Settings.data.general.animationDisabled ? 0 : Math.round(750 / Settings.data.general.animationSpeed)
// Delays
property int tooltipDelay: 300
+24 -11
View File
@@ -104,22 +104,35 @@ ColumnLayout {
// Animation Speed
ColumnLayout {
spacing: Style.marginXXS * scaling
spacing: Style.marginL * scaling
Layout.fillWidth: true
NLabel {
label: I18n.tr("settings.general.ui.animation-speed.label")
description: I18n.tr("settings.general.ui.animation-speed.description")
NToggle {
label: I18n.tr("settings.general.ui.animation-disable.label")
description: I18n.tr("settings.general.ui.animation-disable.description")
checked: Settings.data.general.animationDisabled
onToggled: checked => Settings.data.general.animationDisabled = checked
}
NValueSlider {
ColumnLayout {
spacing: Style.marginXXS * scaling
Layout.fillWidth: true
from: 0.1
to: 2.0
stepSize: 0.01
value: Settings.data.general.animationSpeed
onMoved: value => Settings.data.general.animationSpeed = value
text: Math.round(Settings.data.general.animationSpeed * 100) + "%"
visible: !Settings.data.general.animationDisabled
NLabel {
label: I18n.tr("settings.general.ui.animation-speed.label")
description: I18n.tr("settings.general.ui.animation-speed.description")
}
NValueSlider {
Layout.fillWidth: true
from: 0.1
to: 2.0
stepSize: 0.01
value: Settings.data.general.animationSpeed
onMoved: value => Settings.data.general.animationSpeed = value
text: Math.round(Settings.data.general.animationSpeed * 100) + "%"
}
}
}
}