simplify fade in code a little
This commit is contained in:
parent
822602d602
commit
6e2ee55701
|
@ -138,8 +138,6 @@
|
||||||
[subLine drawInRect: lineRect withAttributes: fSubLineAttributes];
|
[subLine drawInRect: lineRect withAttributes: fSubLineAttributes];
|
||||||
|
|
||||||
[fBadge unlockFocus];
|
[fBadge unlockFocus];
|
||||||
|
|
||||||
[self setNeedsDisplay: YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) drawRect: (NSRect) rect
|
-(void) drawRect: (NSRect) rect
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
@interface DragOverlayWindow (Private)
|
@interface DragOverlayWindow (Private)
|
||||||
|
|
||||||
|
- (void) beginFadeIn;
|
||||||
- (void) fadeIn;
|
- (void) fadeIn;
|
||||||
- (void) fadeOut;
|
- (void) fadeOut;
|
||||||
|
|
||||||
|
@ -68,18 +69,6 @@
|
||||||
|
|
||||||
- (void) setFiles: (NSArray *) files
|
- (void) setFiles: (NSArray *) files
|
||||||
{
|
{
|
||||||
[self setAlphaValue: 0.0];
|
|
||||||
if (fFadeInTimer)
|
|
||||||
{
|
|
||||||
[fFadeInTimer invalidate];
|
|
||||||
fFadeInTimer = nil;
|
|
||||||
}
|
|
||||||
if (fFadeOutTimer)
|
|
||||||
{
|
|
||||||
[fFadeOutTimer invalidate];
|
|
||||||
fFadeOutTimer = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t size = 0;
|
uint64_t size = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
@ -123,30 +112,15 @@
|
||||||
|
|
||||||
[[self contentView] setOverlay: icon mainLine: name subLine: sizeString];
|
[[self contentView] setOverlay: icon mainLine: name subLine: sizeString];
|
||||||
|
|
||||||
fFadeInTimer = [NSTimer scheduledTimerWithTimeInterval: 0.0075 target: self
|
[self beginFadeIn];
|
||||||
selector: @selector(fadeIn) userInfo: nil repeats: YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning combine
|
|
||||||
- (void) setURL: (NSString *) url
|
- (void) setURL: (NSString *) url
|
||||||
{
|
{
|
||||||
[self setAlphaValue: 0.0];
|
|
||||||
if (fFadeInTimer)
|
|
||||||
{
|
|
||||||
[fFadeInTimer invalidate];
|
|
||||||
fFadeInTimer = nil;
|
|
||||||
}
|
|
||||||
if (fFadeOutTimer)
|
|
||||||
{
|
|
||||||
[fFadeOutTimer invalidate];
|
|
||||||
fFadeOutTimer = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
[[self contentView] setOverlay: [NSImage imageNamed: @"Globe.tiff"]
|
[[self contentView] setOverlay: [NSImage imageNamed: @"Globe.tiff"]
|
||||||
mainLine: NSLocalizedString(@"Web Address", "Drag overlay -> url") subLine: url];
|
mainLine: NSLocalizedString(@"Web Address", "Drag overlay -> url") subLine: url];
|
||||||
|
|
||||||
fFadeInTimer = [NSTimer scheduledTimerWithTimeInterval: 0.0075 target: self
|
[self beginFadeIn];
|
||||||
selector: @selector(fadeIn) userInfo: nil repeats: YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) closeFadeOut
|
- (void) closeFadeOut
|
||||||
|
@ -170,6 +144,24 @@
|
||||||
|
|
||||||
@implementation DragOverlayWindow (Private)
|
@implementation DragOverlayWindow (Private)
|
||||||
|
|
||||||
|
- (void) beginFadeIn
|
||||||
|
{
|
||||||
|
[self setAlphaValue: 0.0];
|
||||||
|
if (fFadeInTimer)
|
||||||
|
{
|
||||||
|
[fFadeInTimer invalidate];
|
||||||
|
fFadeInTimer = nil;
|
||||||
|
}
|
||||||
|
if (fFadeOutTimer)
|
||||||
|
{
|
||||||
|
[fFadeOutTimer invalidate];
|
||||||
|
fFadeOutTimer = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
fFadeInTimer = [NSTimer scheduledTimerWithTimeInterval: 0.0075 target: self
|
||||||
|
selector: @selector(fadeIn) userInfo: nil repeats: YES];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) fadeIn
|
- (void) fadeIn
|
||||||
{
|
{
|
||||||
[self setAlphaValue: [self alphaValue] + 0.1];
|
[self setAlphaValue: [self alphaValue] + 0.1];
|
||||||
|
|
Loading…
Reference in New Issue