Revision: 23904
          http://sourceforge.net/p/bibdesk/svn/23904
Author:   hofman
Date:     2019-06-28 21:53:23 +0000 (Fri, 28 Jun 2019)
Log Message:
-----------
don't cache colors for fileview progress indicators, as it may change based on 
dark mode or preferences

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h 
2019-06-28 14:07:37 UTC (rev 23903)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h 
2019-06-28 21:53:23 UTC (rev 23904)
@@ -55,8 +55,6 @@
 @interface FVProgressIndicatorCell : NSCell
 {
 @private
-    CGColorRef               _fillColor;
-    CGColorRef               _strokeColor;
     CGFloat                  _currentProgress;
     CGFloat                  _currentRotation;
     FVProgressIndicatorStyle _style;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m 
2019-06-28 14:07:37 UTC (rev 23903)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m 
2019-06-28 21:53:23 UTC (rev 23904)
@@ -74,19 +74,10 @@
         _currentProgress = 0;
         _currentRotation = 0;
         _style = FVProgressIndicatorDeterminate;
-        _fillColor = [[self class] _newFillColor];
-        _strokeColor = [[self class] _newStrokeColor];
     }
     return self;
 }
 
-- (void)dealloc
-{
-    CGColorRelease(_fillColor);
-    CGColorRelease(_strokeColor);
-    [super dealloc];
-}
-
 - (void)setCurrentProgress:(CGFloat)progress { _currentProgress = progress; }
 - (CGFloat)currentProgress { return _currentProgress; }
 - (void)setStyle:(FVProgressIndicatorStyle)style { _style = style; }
@@ -110,8 +101,12 @@
     }
     
     if (0 < _currentProgress && _currentProgress < 1) {
-        CGContextSetFillColorWithColor(context, _fillColor);
-        CGContextSetStrokeColorWithColor(context, _strokeColor);
+        CGColorRef fillColor = [[self class] _newFillColor];
+        CGColorRef strokeColor = [[self class] _newStrokeColor];
+        CGContextSetFillColorWithColor(context, fillColor);
+        CGContextSetStrokeColorWithColor(context, strokeColor);
+        CGColorRelease(fillColor);
+        CGColorRelease(strokeColor);
         CGContextBeginPath(context);
         CGFloat radius = CGRectGetWidth(progressRect) / 2;
         CGContextMoveToPoint(context, ctr.x, ctr.y);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to