diff options
| author | David Reitter | 2009-06-14 22:29:15 +0000 |
|---|---|---|
| committer | David Reitter | 2009-06-14 22:29:15 +0000 |
| commit | 5ee6f6296a21c3c2e31a50f5bbdc586708cedd80 (patch) | |
| tree | d41ae317e685b240393258aab8994d0339c0816d /src/nsmenu.m | |
| parent | 4b7f335c113bf32ecd1a81a5bdc4e5c0899e233b (diff) | |
| download | emacs-5ee6f6296a21c3c2e31a50f5bbdc586708cedd80.tar.gz emacs-5ee6f6296a21c3c2e31a50f5bbdc586708cedd80.zip | |
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) | |||
| 1439 | { | 1439 | { |
| 1440 | NSString *str = [NSString stringWithUTF8String: text]; | 1440 | NSString *str = [NSString stringWithUTF8String: text]; |
| 1441 | NSRect r = [textField frame]; | 1441 | NSRect r = [textField frame]; |
| 1442 | r.size.width = [[[textField font] screenFont] widthOfString: str] + 8; | 1442 | NSSize textSize = [str sizeWithAttributes: |
| 1443 | [NSDictionary dictionaryWithObject: [[textField font] screenFont] | ||
| 1444 | forKey: NSFontAttributeName]]; | ||
| 1445 | NSSize padSize = [[[textField font] screenFont] | ||
| 1446 | boundingRectForFont].size; | ||
| 1447 | |||
| 1448 | r.size.width = textSize.width + padSize.width/2; | ||
| 1449 | r.size.height = textSize.height + padSize.height/2; | ||
| 1443 | [textField setFrame: r]; | 1450 | [textField setFrame: r]; |
| 1444 | [textField setStringValue: str]; | 1451 | [textField setStringValue: str]; |
| 1445 | } | 1452 | } |