]> git.eshelyaron.com Git - emacs.git/commitdiff
nsmenu.m (EmacsTooltip: setText): set height of tooltip.
authorDavid Reitter <david.reitter@gmail.com>
Sun, 14 Jun 2009 22:29:15 +0000 (22:29 +0000)
committerDavid Reitter <david.reitter@gmail.com>
Sun, 14 Jun 2009 22:29:15 +0000 (22:29 +0000)
src/ChangeLog
src/nsmenu.m

index 8b3ebdc763ec587ad6b31c35f6e3362d1e324c1d..08ac6ceac9aa8184b7ae05f222c2e389af96269d 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-14  Sidney Markowitz <sidney@sidney.com>
+
+       * nsmenu.m (EmacsTooltip: setText): set height of tooltip.
+
 2009-06-14  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
        * nsfont.m (ns_attribute_value): Remove.
index 190bbb3762400308b8001728659b1c096d4e2558..aab3016e5e80634217eee31e0089ca130594a920 100644 (file)
@@ -1439,7 +1439,14 @@ update_frame_tool_bar (FRAME_PTR f)
 {
   NSString *str = [NSString stringWithUTF8String: text];
   NSRect r = [textField frame];
-  r.size.width = [[[textField font] screenFont] widthOfString: str] + 8;
+  NSSize textSize = [str sizeWithAttributes: 
+     [NSDictionary dictionaryWithObject: [[textField font] screenFont]
+                                forKey: NSFontAttributeName]];
+  NSSize padSize = [[[textField font] screenFont] 
+                    boundingRectForFont].size;
+  r.size.width = textSize.width + padSize.width/2;
+  r.size.height = textSize.height + padSize.height/2;
   [textField setFrame: r];
   [textField setStringValue: str];
 }