mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
Updated -cellSize to process multiline string value. This should
improve greately the behaviour of NSTextField and consequently of the NSPanel building functions. Updated -[NSCell _drawText:inFrame:] and -[NSButtonCell drawInteriorWithFrame:inView:] to handle properly multiline strings. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6257 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
99f2fb6496
commit
23a6b9f034
2 changed files with 54 additions and 24 deletions
|
@ -48,6 +48,7 @@
|
|||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
#include "GSUtil.h"
|
||||
|
||||
|
||||
@implementation NSButtonCell
|
||||
|
@ -489,11 +490,10 @@
|
|||
imageSize = [imageToDisplay size];
|
||||
}
|
||||
|
||||
if (titleToDisplay && (ipos == NSImageAbove || ipos == NSImageBelow))
|
||||
{
|
||||
titleSize = NSMakeSize([_cell_font widthOfString: titleToDisplay],
|
||||
[_cell_font boundingRectForFont].size.height);
|
||||
}
|
||||
if (titleToDisplay && (ipos == NSImageAbove || ipos == NSImageBelow)) {
|
||||
titleSize =GSUtil_sizeOfMultilineStringWithFont(titleToDisplay,
|
||||
_cell_font);
|
||||
}
|
||||
|
||||
if (flippedView == YES)
|
||||
{
|
||||
|
@ -686,11 +686,12 @@
|
|||
else
|
||||
imageSize = NSZeroSize;
|
||||
|
||||
if (titleToDisplay)
|
||||
titleSize = NSMakeSize ([_cell_font widthOfString: titleToDisplay],
|
||||
[_cell_font boundingRectForFont].size.height);
|
||||
else
|
||||
titleSize = NSZeroSize;
|
||||
if(titleToDisplay!=nil){
|
||||
titleSize=GSUtil_sizeOfMultilineStringWithFont(titleToDisplay,
|
||||
_cell_font);
|
||||
}else{
|
||||
titleSize=NSZeroSize;
|
||||
}
|
||||
|
||||
switch (_cell.image_position)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue