diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-08-14 12:52:23 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-08-14 12:52:23 +0000 |
commit | db7399d810986569ba54ff5c83ea9c066112a33d (patch) | |
tree | a1a2d158906d6ab5821473279c2ff1c2a8cdcdae /Source/SPTooltip.m | |
parent | 1fdf6898c1750fc0af72d9919cf370855f6a5bf2 (diff) | |
download | sequelpro-db7399d810986569ba54ff5c83ea9c066112a33d.tar.gz sequelpro-db7399d810986569ba54ff5c83ea9c066112a33d.tar.bz2 sequelpro-db7399d810986569ba54ff5c83ea9c066112a33d.zip |
• minor changes to SPTooltip
• some work on the SPFieldEditor's undo manager (has to be continued)
Diffstat (limited to 'Source/SPTooltip.m')
-rw-r--r-- | Source/SPTooltip.m | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/SPTooltip.m b/Source/SPTooltip.m index 9503262c..aa3e906f 100644 --- a/Source/SPTooltip.m +++ b/Source/SPTooltip.m @@ -58,6 +58,8 @@ #import "SPTooltip.h" #import "SPTextViewAdditions.h" +static int spTooltipCounter = 0; + static float slow_in_out (float t) { if(t < 1.0f) @@ -113,6 +115,8 @@ static float slow_in_out (float t) + (void)showWithObject:(id)content atLocation:(NSPoint)point ofType:(NSString *)type displayOptions:(NSDictionary *)displayOptions { + spTooltipCounter++; + SPTooltip* tip = [SPTooltip new]; [tip initMeWithOptions:displayOptions]; [tip setFrameTopLeftPoint:point]; @@ -367,8 +371,9 @@ static float slow_in_out (float t) - (void)animationTick:(id)sender { - float alpha = 0.97f * (1.0f - slow_in_out(-2.8 * [animationStart timeIntervalSinceNow])); - if(alpha > 0.0f) + float alpha = 0.97f * (1.0f - 40*slow_in_out(-2.2 * [animationStart timeIntervalSinceNow])); + + if(alpha > 0.0f && spTooltipCounter==1) { [self setAlphaValue:alpha]; } @@ -377,6 +382,8 @@ static float slow_in_out (float t) [super orderOut:self]; [self stopAnimation:self]; [self close]; + spTooltipCounter--; + if(spTooltipCounter < 0) spTooltipCounter = 0; } } |