Example #1
0
        public static void Initialize(BatteryMaxConfiguration config)
        {
            MinimumCharge = GetChargeLevel(config.ChargeLevels.Minimum, nameof(MinimumCharge));
            MaximumCharge = GetChargeLevel(config.ChargeLevels.Maximum, nameof(MaximumCharge));
            ValidateChargeLevels();

            BackgroundColor           = GetIconColor(config.IconColors.Background, nameof(BackgroundColor));
            ForegroundColorDarkTheme  = GetIconColor(config.IconColors.ForegroundDarkTheme, nameof(ForegroundColorDarkTheme));
            ForegroundColorLightTheme = GetIconColor(config.IconColors.ForegroundLightTheme, nameof(ForegroundColorLightTheme));

            ChargingColor = GetIconColor(config.IconColors.Charging, nameof(ChargingColor));
            DrainingColor = GetIconColor(config.IconColors.Draining, nameof(DrainingColor));
            WarningColor  = GetIconColor(config.IconColors.Warning, nameof(WarningColor));
            CriticalColor = GetIconColor(config.IconColors.Critical, nameof(CriticalColor));

            var batteryIconDefaults = BatteryMaxConfiguration.BatteryIconDefaults();

            BatteryIcon100 = config.BatteryIcon100 ?? batteryIconDefaults.BatteryIcon100;
            BatteryIcon150 = config.BatteryIcon150 ?? batteryIconDefaults.BatteryIcon150;
        }
Example #2
0
        public IconSettings(BatteryIcon batteryIcon, WindowsTheme theme)
        {
            this.batteryIcon = batteryIcon;

            ForegroundColor = theme == WindowsTheme.Light ? Settings.ForegroundColorLightTheme : Settings.ForegroundColorDarkTheme;
        }