Move corner view drawing into GSTheme.

Add new 10.3 methods for NSTableHeaderCell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28985 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2009-11-09 14:53:59 +00:00
parent 6f96e84bc6
commit 48bf51f21c
7 changed files with 90 additions and 27 deletions

View file

@ -24,19 +24,20 @@
Boston, MA 02110-1301, USA.
*/
#include "AppKit/NSTableHeaderCell.h"
#include "AppKit/NSColor.h"
#include "AppKit/NSFont.h"
#import "AppKit/NSColor.h"
#import "AppKit/NSFont.h"
#import "AppKit/NSImage.h"
#import "AppKit/NSTableHeaderCell.h"
#include "GNUstepGUI/GSTheme.h"
@implementation NSTableHeaderCell
{
}
// Default appearance of NSTableHeaderCell
- (id) initTextCell: (NSString *)aString
{
[super initTextCell: aString];
self = [super initTextCell: aString];
if (!self)
return nil;
[self setAlignment: NSCenterTextAlignment];
[self setTextColor: [NSColor windowFrameTextColor]];
@ -75,6 +76,36 @@
[self _drawBackgroundWithFrame: cellFrame inView: controlView];
}
- (void) drawSortIndicatorWithFrame: (NSRect)cellFrame
inView: (NSView *)controlView
ascending: (BOOL)ascending
priority: (int)priority
{
NSImage *img;
cellFrame = [self sortIndicatorRectForBounds: cellFrame];
if (ascending)
img = [NSImage imageNamed: @"NSAscendingSortIndicator"];
else
img = [NSImage imageNamed: @"NSDescendingSortIndicator"];
[img drawAtPoint: cellFrame.origin
fromRect: NSZeroRect
operation: NSCompositeSourceOver
fraction: 1.0];
}
- (NSRect) sortIndicatorRectForBounds: (NSRect)theRect
{
NSImage *img = [NSImage imageNamed: @"NSAscendingSortIndicator"];
NSSize size = [img size];
theRect.origin.x = NSMaxX(theRect) - size.width;
theRect.size = size;
return theRect;
}
- (void) setHighlighted: (BOOL)flag
{
_cell.is_highlighted = flag;