mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 19:01:15 +00:00
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:
parent
84dba1a566
commit
ac2355bae0
1 changed files with 10 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue