diff options
author | David Reitter <david.reitter@gmail.com> | 2009-06-14 22:29:15 +0000 |
---|---|---|
committer | David Reitter <david.reitter@gmail.com> | 2009-06-14 22:29:15 +0000 |
commit | 5ee6f6296a21c3c2e31a50f5bbdc586708cedd80 (patch) | |
tree | d41ae317e685b240393258aab8994d0339c0816d /src/nsmenu.m | |
parent | 4b7f335c113bf32ecd1a81a5bdc4e5c0899e233b (diff) | |
download | emacs-5ee6f6296a21c3c2e31a50f5bbdc586708cedd80.tar.gz |
nsmenu.m (EmacsTooltip: setText): set height of tooltip.
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r-- | src/nsmenu.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 190bbb37624..aab3016e5e8 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -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]; } |