[Adium-commits] adium 2007:2c261bad5dd4: redundancy--;

adium-commits at adiumx.com adium-commits at adiumx.com
Tue Apr 28 06:21:29 UTC 2009


details:	http://hg.adiumx.com/adium/rev/2c261bad5dd4
revision:	2007:2c261bad5dd4
author:		David Smith <catfish.man at gmail.com>
date:		Mon Apr 27 23:21:18 2009 -0700

redundancy--;

diffstat:

 Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h |  10 +----
 Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m |  17 ++------
 Frameworks/AIUtilities Framework/Source/AIAlternatingRowTableView.m   |   7 ---
 Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m |   2 +-
 Frameworks/Adium Framework/Source/AIAbstractListController.m          |   2 +-
 Frameworks/Adium Framework/Source/AIListCell.m                        |   2 +-
 Frameworks/Adium Framework/Source/ESContactAlertsViewController.m     |   2 +-
 Source/ESFileTransferProgressWindowController.m                       |   2 +-
 8 files changed, 10 insertions(+), 34 deletions(-)

diffs (160 lines):

diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h	Mon Apr 27 23:21:18 2009 -0700
@@ -24,22 +24,14 @@
 @interface AIAlternatingRowOutlineView : AIOutlineView {
 	NSColor		*alternatingRowColor;
 	
-	BOOL		drawsAlternatingRows;
 	BOOL		drawsBackground;
 	BOOL		drawsGradientSelection;
 }
 
 /*!
- * @brief Whether the outline view draws a grid, alternating by rows.
- *
- * The grid will be drawn alternating between the background color and the color specified by setAlternatingRowColor:, which has a sane, light blue default.
- */
- at property (readwrite, nonatomic) BOOL drawsAlternatingRows;
-
-/*!
  * @brief The color used for drawing alternating row backgrounds.
  *
- * Ignored if drawsAlternatingRows is NO.
+ * Ignored if usesAlternatingRowBackgroundColors is NO.
  */
 @property (readwrite, nonatomic, retain) NSColor *alternatingRowColor;
 
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m	Mon Apr 27 23:21:18 2009 -0700
@@ -55,7 +55,7 @@
 
 - (void)initAlternatingRowOutlineView
 {
-	drawsAlternatingRows = NO;
+	[self setUsesAlternatingRowBackgroundColors:NO];
 	drawsBackground = YES;
 	drawsGradientSelection = NO;
 	alternatingRowColor = [[NSColor colorWithCalibratedRed:(237.0/255.0) green:(243.0/255.0) blue:(254.0/255.0) alpha:1.0] retain];
@@ -76,15 +76,6 @@
 
 
 //Configuring ----------------------------------------------------------------------
-//Toggle the drawing of alternating rows
-- (void)setDrawsAlternatingRows:(BOOL)flag
-{
-	drawsAlternatingRows = flag;
-	[self setNeedsDisplay:YES];
-}
-- (BOOL)drawsAlternatingRows{
-	return drawsAlternatingRows;
-}
 
 - (void)setDrawsGradientSelection:(BOOL)inDrawsGradientSelection
 {
@@ -132,7 +123,7 @@
 //Draw the alternating colors and grid below the "bottom" of the outlineview
 - (void)drawAlternatingRowsInRect:(NSRect)rect
 {
-	if (!drawsBackground || !drawsAlternatingRows) 
+	if (!drawsBackground || ![self usesAlternatingRowBackgroundColors]) 
 	    return;
 
 	unsigned	rectNumber = 0;
@@ -163,7 +154,7 @@
 {
 	[super drawRect:rect];
 
-	if (drawsBackground && drawsAlternatingRows && [self gridStyleMask] != NSTableViewGridNone) {
+	if (drawsBackground && [self usesAlternatingRowBackgroundColors] && [self gridStyleMask] != NSTableViewGridNone) {
 		[self _drawGridInClipRect:rect];
 	}
 }
@@ -250,7 +241,7 @@
 
 - (void)drawGridInClipRect:(NSRect)rect
 {
-    if (drawsBackground && drawsAlternatingRows) {
+    if (drawsBackground && [self usesAlternatingRowBackgroundColors]) {
 		//We do our grid drawing later
 	} else {
 		[super drawGridInClipRect:rect];
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/AIUtilities Framework/Source/AIAlternatingRowTableView.m
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowTableView.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowTableView.m	Mon Apr 27 23:21:18 2009 -0700
@@ -67,14 +67,7 @@
     [super dealloc];
 }
 
-
 //Configuring ----------------------------------------------------------------------
-- (void)setDrawsAlternatingRows:(BOOL)flag
-{
-	[self setUsesAlternatingRowBackgroundColors:flag];
-
-    [self setNeedsDisplay:YES];
-}
 
 //Filter keydowns looking for the delete key (to delete the current selection)
 - (void)keyDown:(NSEvent *)theEvent
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m
--- a/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m	Mon Apr 27 23:21:18 2009 -0700
@@ -202,7 +202,7 @@
 	/* Draw the alternating rows.  If we draw alternating rows, the cell in the first column
 	 * can optionally suppress drawing.
 	 */
-	if ([self drawsAlternatingRows]) {
+	if ([self usesAlternatingRowBackgroundColors]) {
 		BOOL alternateColor = YES;
 		int numberOfRows = [self numberOfRows], rectNumber = 0;
 		NSTableColumn *tableColumn = [[self tableColumns] objectAtIndex:0];
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/Adium Framework/Source/AIAbstractListController.m
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m	Mon Apr 27 23:21:18 2009 -0700
@@ -483,7 +483,7 @@
 	}
 	
 	//Background
-	[contactListView setDrawsAlternatingRows:[[themeDict objectForKey:KEY_LIST_THEME_GRID_ENABLED] boolValue]];
+	[contactListView setUsesAlternatingRowBackgroundColors:[[themeDict objectForKey:KEY_LIST_THEME_GRID_ENABLED] boolValue]];
 	[contactListView setBackgroundFade:[[themeDict objectForKey:KEY_LIST_THEME_BACKGROUND_FADE] floatValue]];
 	[contactListView setBackgroundColor:[[themeDict objectForKey:KEY_LIST_THEME_BACKGROUND_COLOR] representedColor]];
 	[contactListView setAlternatingRowColor:[[themeDict objectForKey:KEY_LIST_THEME_GRID_COLOR] representedColor]];
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/Adium Framework/Source/AIListCell.m
--- a/Frameworks/Adium Framework/Source/AIListCell.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListCell.m	Mon Apr 27 23:21:18 2009 -0700
@@ -388,7 +388,7 @@
 - (NSColor *)backgroundColor
 {
 	//We could just call backgroundColorForRow: but it's best to avoid doing a rowForItem lookup if there is no grid
-	if ([controlView drawsAlternatingRows]) {
+	if ([controlView usesAlternatingRowBackgroundColors]) {
 		return [controlView backgroundColorForRow:[controlView rowForItem:proxyObject]];
 	} else {
 		return [controlView backgroundColor];
diff -r d85b02c6740f -r 2c261bad5dd4 Frameworks/Adium Framework/Source/ESContactAlertsViewController.m
--- a/Frameworks/Adium Framework/Source/ESContactAlertsViewController.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Frameworks/Adium Framework/Source/ESContactAlertsViewController.m	Mon Apr 27 23:21:18 2009 -0700
@@ -349,7 +349,7 @@
 	[[outlineView_summary tableColumnWithIdentifier:@"action"] setDataCell:verticallyCenteredTextCell];
 	[verticallyCenteredTextCell release];
 
-	[outlineView_summary setDrawsAlternatingRows:YES];
+	[outlineView_summary setUsesAlternatingRowBackgroundColors:YES];
 	[outlineView_summary setIntercellSpacing:NSMakeSize(6.0,6.0)];
 	[outlineView_summary setIndentationPerLevel:0];
 	[outlineView_summary setTarget:self];
diff -r d85b02c6740f -r 2c261bad5dd4 Source/ESFileTransferProgressWindowController.m
--- a/Source/ESFileTransferProgressWindowController.m	Mon Apr 27 22:54:36 2009 -0700
+++ b/Source/ESFileTransferProgressWindowController.m	Mon Apr 27 23:21:18 2009 -0700
@@ -138,7 +138,7 @@
 	[outlineView sizeLastColumnToFit];
 	[outlineView setAutoresizesSubviews:YES];
 	[outlineView setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle];
-	[outlineView setDrawsAlternatingRows:YES];
+	[outlineView setUsesAlternatingRowBackgroundColors:YES];
 	[outlineView setDataSource:self];
 	[outlineView setDelegate:self];
 




More information about the commits mailing list