mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Fixed drawing of titles.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5071 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b17af0e5d0
commit
c8894602a5
1 changed files with 29 additions and 8 deletions
|
@ -152,6 +152,34 @@
|
|||
|
||||
@end
|
||||
|
||||
@interface GSBrowserTitleCell: NSTextFieldCell
|
||||
@end
|
||||
|
||||
@implementation GSBrowserTitleCell
|
||||
- (id) initTextCell: (NSString *)aString
|
||||
{
|
||||
[super initTextCell: aString];
|
||||
|
||||
[self setTextColor: [NSColor windowFrameTextColor]];
|
||||
[self setBackgroundColor: [NSColor controlShadowColor]];
|
||||
[self setEditable: NO];
|
||||
[self setBezeled: YES];
|
||||
[self setAlignment: NSCenterTextAlignment];
|
||||
draw_background = YES;
|
||||
return self;
|
||||
}
|
||||
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||
{
|
||||
if (NSIsEmptyRect (cellFrame))
|
||||
return;
|
||||
|
||||
[controlView lockFocus];
|
||||
NSDrawGrayBezel (cellFrame, NSZeroRect);
|
||||
[controlView unlockFocus];
|
||||
[self drawInteriorWithFrame: cellFrame inView: controlView];
|
||||
}
|
||||
@end
|
||||
|
||||
//
|
||||
// Private NSBrowser methods
|
||||
//
|
||||
|
@ -227,14 +255,7 @@
|
|||
_passiveDelegate = YES;
|
||||
_doubleAction = NULL;
|
||||
_browserColumns = [[NSMutableArray alloc] init];
|
||||
_titleCell = [NSTextFieldCell new];
|
||||
[_titleCell setEditable: NO];
|
||||
[_titleCell setTextColor: [NSColor windowFrameTextColor]];
|
||||
[_titleCell setBackgroundColor: [NSColor controlShadowColor]];
|
||||
[_titleCell setDrawsBackground: YES];
|
||||
//[_titleCell setBordered: YES];
|
||||
[_titleCell setBezeled: YES];
|
||||
[_titleCell setAlignment: NSCenterTextAlignment];
|
||||
_titleCell = [GSBrowserTitleCell new];
|
||||
|
||||
// Calculate geometry
|
||||
[self tile];
|
||||
|
|
Loading…
Reference in a new issue