Added defaultForegroundColor

git-svn-id: http://macvim.googlecode.com/svn/trunk@210 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-08-29 10:39:36 +00:00
parent 08131ebe16
commit c10671e6fd
2 changed files with 20 additions and 3 deletions
+2
View File
@@ -20,6 +20,7 @@
NSAttributedString *emptyRowString;
NSFont *font;
NSColor *defaultBackgroundColor;
NSColor *defaultForegroundColor;
NSSize cellSize;
}
@@ -51,6 +52,7 @@
- (void)setFont:(NSFont *)newFont;
- (NSFont *)font;
- (NSColor *)defaultBackgroundColor;
- (NSColor *)defaultForegroundColor;
- (NSSize)size;
- (NSSize)cellSize;
- (NSRect)rectForRowsInRange:(NSRange)range;
+18 -3
View File
@@ -55,6 +55,7 @@
[emptyRowString release];
[font release];
[defaultBackgroundColor release];
[defaultForegroundColor release];
[attribString release];
[super dealloc];
}
@@ -374,9 +375,18 @@
- (void)setDefaultColorsBackground:(NSColor *)bgColor
foreground:(NSColor *)fgColor
{
// NOTE: Foreground color is ignored.
[defaultBackgroundColor release];
defaultBackgroundColor = bgColor ? [bgColor retain] : nil;
if (defaultBackgroundColor != bgColor) {
[defaultBackgroundColor release];
defaultBackgroundColor = bgColor ? [bgColor retain] : nil;
}
// NOTE: The default foreground color isn't actually used for anything, but
// other class instances might want to be able to access it so it is stored
// here.
if (defaultForegroundColor != fgColor) {
[defaultForegroundColor release];
defaultForegroundColor = fgColor ? [fgColor retain] : nil;
}
}
- (void)setFont:(NSFont*)newFont
@@ -422,6 +432,11 @@
return defaultBackgroundColor;
}
- (NSColor *)defaultForegroundColor
{
return defaultForegroundColor;
}
- (NSSize)size
{
return NSMakeSize(maxColumns*cellSize.width, maxRows*cellSize.height);