diff --git a/AppKit/CPLevelIndicator.j b/AppKit/CPLevelIndicator.j index 042b17e84..07ce720c3 100644 --- a/AppKit/CPLevelIndicator.j +++ b/AppKit/CPLevelIndicator.j @@ -105,10 +105,21 @@ CPRatingLevelIndicatorStyle = 3; var filledColor = [self valueForThemeAttribute:@"color-normal"], value = [self doubleValue]; - if (value <= _criticalValue) - filledColor = [self valueForThemeAttribute:@"color-critical"]; - else if (value <= _warningValue) - filledColor = [self valueForThemeAttribute:@"color-warning"]; + if (_warningValue < _criticalValue) + { + if (value >= _criticalValue) + filledColor = [self valueForThemeAttribute:@"color-critical"]; + else if (value >= _warningValue) + filledColor = [self valueForThemeAttribute:@"color-warning"]; + } + else + { + if (value <= _criticalValue) + filledColor = [self valueForThemeAttribute:@"color-critical"]; + else if (value <= _warningValue) + filledColor = [self valueForThemeAttribute:@"color-warning"]; + } + for (var i = 0; i < segmentCount; i++) {