Revision: 23909
          http://sourceforge.net/p/bibdesk/svn/23909
Author:   hofman
Date:     2019-07-01 09:15:34 +0000 (Mon, 01 Jul 2019)
Log Message:
-----------
update animation step of progress cell by timer rather than drawing, there can 
be extra drawing steps in between firing

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

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-07-01 
06:30:19 UTC (rev 23908)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-07-01 
09:15:34 UTC (rev 23909)
@@ -4050,6 +4050,7 @@
 
 - (void)_progressTimerFired:(CFRunLoopTimerRef)timer
 {
+    [[_downloads valueForKey:@"progressIndicator"] 
makeObjectsPerformSelector:@selector(animate)];
     [self setNeedsDisplay:YES];
 }
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h 
2019-07-01 06:30:19 UTC (rev 23908)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.h 
2019-07-01 09:15:34 UTC (rev 23909)
@@ -64,6 +64,9 @@
 - (CGFloat)currentProgress;
 
 // default is FVProgressIndicatorDeterminate
+- (FVProgressIndicatorStyle)style;
 - (void)setStyle:(FVProgressIndicatorStyle)style;
 
+- (void)animate;
+
 @end

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m 
2019-07-01 06:30:19 UTC (rev 23908)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVProgressIndicatorCell.m 
2019-07-01 09:15:34 UTC (rev 23909)
@@ -54,8 +54,16 @@
 
 - (void)setCurrentProgress:(CGFloat)progress { _currentProgress = progress; }
 - (CGFloat)currentProgress { return _currentProgress; }
+
+- (FVProgressIndicatorStyle)style {return _style; }
 - (void)setStyle:(FVProgressIndicatorStyle)style { _style = style; }
 
+- (void)animate
+{
+    if (_style == FVProgressIndicatorIndeterminate)
+        _currentStep = (_currentStep + 1) % 12;
+}
+
 - (void)drawWithFrame:(NSRect)aRect inView:(NSView *)aView
 {
     CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
@@ -85,7 +93,6 @@
             CGContextRotateCTM(context, -angle);
             CGContextTranslateCTM(context, -ctr.x, -ctr.y);
         }
-        _currentStep = (_currentStep + 1) % 12;
     } else {
         // determinate download length
         CGContextTranslateCTM(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