Author: fredkiefer
Date: Tue Nov  3 09:33:31 2015
New Revision: 39130

URL: http://svn.gna.org/viewcvs/gnustep?rev=39130&view=rev
Log:
        * Source/GSToolTips.m (-_timedOut:): Break long tool tips into
        multiple lines.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/GSToolTips.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=39130&r1=39129&r2=39130&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Tue Nov  3 09:33:31 2015
@@ -1,3 +1,8 @@
+2015-11-03 Fred Kiefer <[email protected]>
+
+       * Source/GSToolTips.m (-_timedOut:): Break long tool tips into
+       multiple lines.
+
 2015-11-02 Fred Kiefer <[email protected]>
 
        * Source/NSWindow.m (-constrainFrameRect:toScreen:) Handle screen

Modified: libs/gui/trunk/Source/GSToolTips.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSToolTips.m?rev=39130&r1=39129&r2=39130&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSToolTips.m  (original)
+++ libs/gui/trunk/Source/GSToolTips.m  Tue Nov  3 09:33:31 2015
@@ -642,6 +642,15 @@
     [[NSAttributedString alloc] initWithString: toolTipString
                                    attributes: attributes];
   textSize = [toolTipText size];
+  if (textSize.width > 300)
+    {
+      NSRect rect;
+      rect = [toolTipText boundingRectWithSize: NSMakeSize(300, 1e7)
+                                       options: 0];
+      textSize = rect.size;
+      // This extra pixel is needed, otherwise the last line gets cut off.
+      textSize.height += 1;
+    }
 
   /* Create window just off the current mouse position
    * Constrain it to be on screen, shrinking if necessary.


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

Reply via email to