perf/feat: gate cpu behaviors on _showPanel; add reducedMotion theme setting for ambient animations
This commit is contained in:
parent
937ae5af2e
commit
c96b023fbe
4 changed files with 11 additions and 2 deletions
|
|
@ -54,6 +54,7 @@ PanelWindow {
|
||||||
text: ":"
|
text: ":"
|
||||||
color: colon._colors[colon._colorIdx % colon._colors.length]
|
color: colon._colors[colon._colorIdx % colon._colors.length]
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
|
enabled: !M.Theme.reducedMotion
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 800
|
duration: 800
|
||||||
}
|
}
|
||||||
|
|
@ -110,6 +111,7 @@ PanelWindow {
|
||||||
readonly property var _colors: [M.Theme.base08, M.Theme.base09, M.Theme.base0A, M.Theme.base0B, M.Theme.base0C, M.Theme.base0D, M.Theme.base0E, M.Theme.base05]
|
readonly property var _colors: [M.Theme.base08, M.Theme.base09, M.Theme.base0A, M.Theme.base0B, M.Theme.base0C, M.Theme.base0D, M.Theme.base0E, M.Theme.base05]
|
||||||
color: _colors[_colorIdx % _colors.length]
|
color: _colors[_colorIdx % _colors.length]
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
|
enabled: !M.Theme.reducedMotion
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 800
|
duration: 800
|
||||||
}
|
}
|
||||||
|
|
@ -117,7 +119,7 @@ PanelWindow {
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
running: true
|
running: !M.Theme.reducedMotion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: colon
|
target: colon
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
|
@ -187,6 +189,7 @@ PanelWindow {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
color: colon._colors[colon._colorIdx % colon._colors.length]
|
color: colon._colors[colon._colorIdx % colon._colors.length]
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
|
enabled: !M.Theme.reducedMotion
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 800
|
duration: 800
|
||||||
}
|
}
|
||||||
|
|
@ -195,6 +198,7 @@ PanelWindow {
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
|
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
|
enabled: !M.Theme.reducedMotion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ M.BarSection {
|
||||||
|
|
||||||
property int usage: M.SystemStats.cpuUsage
|
property int usage: M.SystemStats.cpuUsage
|
||||||
Behavior on usage {
|
Behavior on usage {
|
||||||
|
enabled: root._showPanel
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 400
|
duration: 400
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
|
|
@ -16,6 +17,7 @@ M.BarSection {
|
||||||
|
|
||||||
property real freqGhz: M.SystemStats.cpuFreqGhz
|
property real freqGhz: M.SystemStats.cpuFreqGhz
|
||||||
Behavior on freqGhz {
|
Behavior on freqGhz {
|
||||||
|
enabled: root._showPanel
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 400
|
duration: 400
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ PanelWindow {
|
||||||
// Wave animation: 6s sweep + 8s pause, only while overview is open
|
// Wave animation: 6s sweep + 8s pause, only while overview is open
|
||||||
SequentialAnimation on uWavePhase {
|
SequentialAnimation on uWavePhase {
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
running: M.NiriIpc.overviewOpen
|
running: M.NiriIpc.overviewOpen && !M.Theme.reducedMotion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
from: -200
|
from: -200
|
||||||
to: fx.width + 200
|
to: fx.width + 200
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ QtObject {
|
||||||
property int groupSpacing: 6
|
property int groupSpacing: 6
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
property int screenRadius: 15
|
property int screenRadius: 15
|
||||||
|
property bool reducedMotion: false
|
||||||
|
|
||||||
property FileView _themeFile: FileView {
|
property FileView _themeFile: FileView {
|
||||||
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/theme.json"
|
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/theme.json"
|
||||||
|
|
@ -75,5 +76,7 @@ QtObject {
|
||||||
root.radius = data.radius;
|
root.radius = data.radius;
|
||||||
if (data.screenRadius !== undefined)
|
if (data.screenRadius !== undefined)
|
||||||
root.screenRadius = data.screenRadius;
|
root.screenRadius = data.screenRadius;
|
||||||
|
if (data.reducedMotion !== undefined)
|
||||||
|
root.reducedMotion = data.reducedMotion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue