mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Fix NSFormCell drawing and sizing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4906 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
25e6b5545e
commit
e3c4c63592
2 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Sep 18 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Source/NSFormCell.m ([-initTextCell:]): Follow the doc: init
|
||||
bezeled. ([-drawWithFrame:inView:]): Tiny fix to have some space
|
||||
between title and text. ([-cellSize]): New method
|
||||
|
||||
Thu Sep 16 8:38:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSBrowserCell.m: Fix for positioning of leaf images.
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
- initTextCell: (NSString *)aString
|
||||
{
|
||||
self = [super initTextCell:@""];
|
||||
[self setBordered:YES];
|
||||
[self setBezeled:YES];
|
||||
[self setAlignment:NSLeftTextAlignment];
|
||||
titleWidth = -1;
|
||||
|
@ -114,6 +113,25 @@
|
|||
return 0;
|
||||
}
|
||||
|
||||
- (NSSize)cellSize
|
||||
{
|
||||
NSSize returnedSize;
|
||||
NSSize titleSize = [titleCell cellSize];
|
||||
NSSize textSize = [super cellSize];
|
||||
|
||||
textSize.width = [cell_font widthOfString: @"minimum"];
|
||||
textSize.height = [cell_font pointSize] + (2 * yDist)
|
||||
+ 2 * ([NSCell sizeForBorderType: NSBezelBorder].height);
|
||||
|
||||
returnedSize.width = titleSize.width + 4 + textSize.width;
|
||||
if (titleSize.height > textSize.height)
|
||||
returnedSize.height = titleSize.height;
|
||||
else
|
||||
returnedSize.height = textSize.height;
|
||||
|
||||
return returnedSize;
|
||||
}
|
||||
|
||||
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||
{
|
||||
NSRect titleFrame;
|
||||
|
@ -121,6 +139,7 @@
|
|||
|
||||
NSDivideRect(cellFrame, &titleFrame, &textFrame,
|
||||
[self titleWidth] + 4, NSMinXEdge);
|
||||
titleFrame.size.width -= 4;
|
||||
|
||||
[titleCell drawWithFrame: titleFrame inView: controlView];
|
||||
[super drawWithFrame: textFrame inView: controlView];
|
||||
|
@ -139,3 +158,4 @@
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue