Support NSInitialToolTipDelay for tooltip timeout

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40483 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2017-04-14 18:57:11 +00:00
parent 84dba1a566
commit ac2355bae0

View file

@ -221,6 +221,7 @@
@interface GSToolTips (Private)
+ (NSTimeInterval) _toolTipTimeout;
- (void) _endDisplay;
- (void) _endDisplay:(NSTrackingRectTag)tag;
- (void) _timedOut: (NSTimer *)timer;
@ -378,7 +379,7 @@ static BOOL restoreMouseMoved;
toolTipString = [self _toolTipForProvider: provider
location: [theEvent locationInWindow]];
timer = [NSTimer scheduledTimerWithTimeInterval: 0.5
timer = [NSTimer scheduledTimerWithTimeInterval: [GSToolTips _toolTipTimeout]
target: self
selector: @selector(_timedOut:)
userInfo: toolTipString
@ -552,6 +553,14 @@ static BOOL restoreMouseMoved;
@implementation GSToolTips (Private)
+ (NSTimeInterval) _toolTipTimeout
{
NSTimeInterval timeout = [[NSUserDefaults standardUserDefaults] doubleForKey: @"NSInitialToolTipDelay"] / 1000.0;
if (timeout == 0)
timeout = 1.0;
return timeout;
}
- (void) _endDisplay
{
[self _endDisplay:NSNotFound];