Author: mlytwyn
Date: Fri Apr 14 20:57:11 2017
New Revision: 40483

URL: http://svn.gna.org/viewcvs/gnustep?rev=40483&view=rev
Log:
Support NSInitialToolTipDelay for tooltip timeout

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/GSToolTips.m

Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSToolTips.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSToolTips.m?rev=40483&r1=40482&r2=40483&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSToolTips.m      
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSToolTips.m      Fri Apr 
14 20:57:11 2017
@@ -221,6 +221,7 @@
 
 
 @interface     GSToolTips (Private)
++ (NSTimeInterval) _toolTipTimeout;
 - (void) _endDisplay;
 - (void) _endDisplay:(NSTrackingRectTag)tag;
 - (void) _timedOut: (NSTimer *)timer;
@@ -378,7 +379,7 @@
   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 @@
 
 @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];


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to