remove the custom alternating row code, since it isn't futureproof

This commit is contained in:
Mitchell Livingston 2011-06-13 22:26:43 +00:00
parent 97d80b72aa
commit 4458697259
11 changed files with 13 additions and 88 deletions

View File

@ -683,80 +683,6 @@
} }
} }
//alternating rows - first row after group row is white
- (void) highlightSelectionInClipRect: (NSRect) clipRect
{
if (![fDefaults boolForKey: @"SmallView"])
{
NSRect visibleRect = clipRect;
NSRange rows = [self rowsInRect: visibleRect];
BOOL start = YES;
const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight / 2.0)) + 1]; //add one if partial rows at top and bottom
NSInteger rectNum = 0;
if (rows.length > 0)
{
//determine what the first row color should be
if ([[self itemAtRow: rows.location] isKindOfClass: [Torrent class]])
{
for (NSInteger i = rows.location-1; i>=0; i--)
{
if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
break;
start = !start;
}
}
else
{
rows.location++;
rows.length--;
}
NSInteger i;
for (i = rows.location; i < NSMaxRange(rows); i++)
{
if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
{
start = YES;
continue;
}
if (!start && ![self isRowSelected: i])
gridRects[rectNum++] = [self rectOfRow: i];
start = !start;
}
const CGFloat newY = NSMaxY([self rectOfRow: i-1]);
visibleRect.size.height -= newY - visibleRect.origin.y;
visibleRect.origin.y = newY;
}
const NSInteger numberBlankRows = ceil(visibleRect.size.height / totalRowHeight);
//remaining visible rows continue alternating
visibleRect.size.height = totalRowHeight;
if (start)
visibleRect.origin.y += totalRowHeight;
for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
{
gridRects[rectNum++] = visibleRect;
visibleRect.origin.y += 2.0 * totalRowHeight;
}
NSAssert([[NSColor controlAlternatingRowBackgroundColors] count] >= 2, @"There should be 2 alternating row colors");
[(NSColor *)[[NSColor controlAlternatingRowBackgroundColors] objectAtIndex: 1] set];
NSRectFillList(gridRects, rectNum);
}
[super highlightSelectionInClipRect: clipRect];
}
- (void) setQuickLimitMode: (id) sender - (void) setQuickLimitMode: (id) sender
{ {
const BOOL limit = [sender tag] == ACTION_MENU_LIMIT_TAG; const BOOL limit = [sender tag] == ACTION_MENU_LIMIT_TAG;

View File

@ -701,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -182,7 +182,6 @@
<string key="NSFrame">{{118, 5}, {279, 14}}</string> <string key="NSFrame">{{118, 5}, {279, 14}}</string>
<reference key="NSSuperview" ref="303120456"/> <reference key="NSSuperview" ref="303120456"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="696487414"> <object class="NSTextFieldCell" key="NSCell" id="696487414">
<int key="NSCellFlags">67239488</int> <int key="NSCellFlags">67239488</int>
@ -228,7 +227,7 @@
<string key="NSFrameSize">{515, 224}</string> <string key="NSFrameSize">{515, 224}</string>
<reference key="NSSuperview" ref="306237956"/> <reference key="NSSuperview" ref="306237956"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1068338331"/> <reference key="NSNextKeyView" ref="365285506"/>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView"> <object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/> <nil key="NSNextResponder"/>
@ -655,7 +654,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>
@ -702,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<string key="NSFrame">{{0, 24}, {515, 224}}</string> <string key="NSFrame">{{0, 24}, {515, 224}}</string>
<reference key="NSSuperview" ref="303120456"/> <reference key="NSSuperview" ref="303120456"/>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="365285506"/> <reference key="NSNextKeyView" ref="306237956"/>
<int key="NSsFlags">528</int> <int key="NSsFlags">528</int>
<reference key="NSVScroller" ref="1068338331"/> <reference key="NSVScroller" ref="1068338331"/>
<reference key="NSHScroller" ref="365285506"/> <reference key="NSHScroller" ref="365285506"/>

View File

@ -647,7 +647,7 @@ AACcWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -701,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -701,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -701,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -653,7 +653,7 @@ JYAAAAzAAABQAAAAVEAAAjMzAAIzMwACMzMAAAAAAAAAAHNmMzIAAAAAAAEMcgAABfj///MdAAAHugAA
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -701,7 +701,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>
@ -761,7 +761,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<reference key="NSWindow"/> <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="87647552"/> <reference key="NSNextKeyView" ref="87647552"/>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMinSize">{350, 27}</string> <string key="NSMinSize">{350, 27}</string>
<string key="NSMaxSize">{1e+13, 1e+13}</string> <string key="NSMaxSize">{1e+13, 1e+13}</string>
<string key="NSFrameAutosaveName">TransmissionWindow</string> <string key="NSFrameAutosaveName">TransmissionWindow</string>

View File

@ -698,7 +698,7 @@ AAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>

View File

@ -699,7 +699,7 @@ AAAAAAAAAAAAAAAAA</bytes>
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes> <bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object> </object>
<double key="NSRowHeight">62</double> <double key="NSRowHeight">62</double>
<int key="NSTvFlags">440434688</int> <int key="NSTvFlags">448823296</int>
<reference key="NSDelegate"/> <reference key="NSDelegate"/>
<reference key="NSDataSource"/> <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">1</int> <int key="NSColumnAutoresizingStyle">1</int>