Skip to content

Commit 961afce

Browse files
committed
Disable animation if on battery
1 parent ae90c8d commit 961afce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

MaterialDesignThemes.Wpf/PaletteHelper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,12 @@ public enum ACLineStatus : byte
153153
private static bool ReplaceEntry(object entryName, object newValue, ResourceDictionary parentDictionary = null, bool animate = true)
154154
{
155155
const int DURATION_MS = 500; //Change the value if needed
156-
int ANIMATION_FPS = GetPowerState().ACLineStatus == Online ? 20 : 60;
157156
if (parentDictionary == null)
158157
parentDictionary = Application.Current.Resources;
159158

160159
if (parentDictionary.Contains(entryName))
161160
{
162-
if (animate & parentDictionary[entryName] != null ) //Fade animation is enabled and value is not null.
161+
if (animate & parentDictionary[entryName] != null & GetPowerState().ACLineStatus == Online) //Fade animation is enabled and value is not null.
163162
{
164163
try
165164
{

0 commit comments

Comments
 (0)