mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Added defaultForegroundColor
git-svn-id: http://macvim.googlecode.com/svn/trunk@210 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user