aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTooltip.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-08-14 12:52:23 +0000
committerBibiko <bibiko@eva.mpg.de>2009-08-14 12:52:23 +0000
commitdb7399d810986569ba54ff5c83ea9c066112a33d (patch)
treea1a2d158906d6ab5821473279c2ff1c2a8cdcdae /Source/SPTooltip.m
parent1fdf6898c1750fc0af72d9919cf370855f6a5bf2 (diff)
downloadsequelpro-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.m11
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;
}
}