Skip to content

Commit 1198435

Browse files
committed
Added ability to config disable on battery
It can be changed the DisableAnimationOnBattery static variable
1 parent ad1ce6d commit 1198435

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MaterialDesignThemes.Wpf/PaletteHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public enum ACLineStatus : byte
143143
{
144144
Offline = 0, Online = 1, Unknown = 255
145145
}
146-
146+
public static bool DisableAnimationOnBattery = true
147147
/// <summary>
148148
/// Replaces a certain entry anywhere in the parent dictionary and its merged dictionaries
149149
/// </summary>
@@ -159,7 +159,8 @@ private static bool ReplaceEntry(object entryName, object newValue, ResourceDict
159159

160160
if (parentDictionary.Contains(entryName))
161161
{
162-
if (animate & parentDictionary[entryName] != null & GetPowerState().ACLineStatus == ACLineStatus.Online & parentDictionary[entryName] as SolidColorBrush != null) //Fade animation is enabled , type is solidcolorbrush and value is not null.
162+
bool battery = GetPowerState().ACLineStatus == ACLineStatus.Online | !DisableAnimationOnBattery;
163+
if (animate & parentDictionary[entryName] != null & battery & parentDictionary[entryName] as SolidColorBrush != null) //Fade animation is enabled , type is solidcolorbrush and value is not null.
163164
{
164165
ColorAnimation animation = new ColorAnimation()
165166
{

0 commit comments

Comments
 (0)