manually draw the alternating row colors - this allows the rows below each group row to start as white

This commit is contained in:
Mitchell Livingston 2008-05-23 19:04:19 +00:00
parent ba8a03024c
commit 5cd3dd1db7
3 changed files with 70 additions and 28 deletions

View File

@ -258,13 +258,8 @@
BE75C3660C72A0EF00DBEFE0 /* signal.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3590C72A0EF00DBEFE0 /* signal.c */; };
BE75C3670C72A0EF00DBEFE0 /* buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35A0C72A0EF00DBEFE0 /* buffer.c */; };
BE75C3680C72A0EF00DBEFE0 /* log.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35B0C72A0EF00DBEFE0 /* log.c */; };
BE75C3690C72A0EF00DBEFE0 /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */; };
BE75C36A0C72A0EF00DBEFE0 /* evbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */; };
BE75C36B0C72A0EF00DBEFE0 /* event.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35E0C72A0EF00DBEFE0 /* event.c */; };
BE75C36C0C72A0EF00DBEFE0 /* http.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35F0C72A0EF00DBEFE0 /* http.c */; };
BE75C36D0C72A0EF00DBEFE0 /* event_tagging.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3600C72A0EF00DBEFE0 /* event_tagging.c */; };
BE75C36E0C72A0EF00DBEFE0 /* evrpc.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3610C72A0EF00DBEFE0 /* evrpc.c */; };
BE75C36F0C72A0EF00DBEFE0 /* evdns.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3620C72A0EF00DBEFE0 /* evdns.c */; };
BE75C3700C72A0EF00DBEFE0 /* poll.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3630C72A0EF00DBEFE0 /* poll.c */; };
BE75C3710C72A0EF00DBEFE0 /* select.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3640C72A0EF00DBEFE0 /* select.c */; };
BE75C38A0C72A1ED00DBEFE0 /* libevent.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE75C3490C729E9500DBEFE0 /* libevent.a */; };
@ -738,18 +733,11 @@
BE75C3590C72A0EF00DBEFE0 /* signal.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = signal.c; path = "third-party/libevent/signal.c"; sourceTree = "<group>"; };
BE75C35A0C72A0EF00DBEFE0 /* buffer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = buffer.c; path = "third-party/libevent/buffer.c"; sourceTree = "<group>"; };
BE75C35B0C72A0EF00DBEFE0 /* log.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = log.c; path = "third-party/libevent/log.c"; sourceTree = "<group>"; };
BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = "third-party/libevent/strlcpy.c"; sourceTree = "<group>"; };
BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evbuffer.c; path = "third-party/libevent/evbuffer.c"; sourceTree = "<group>"; };
BE75C35E0C72A0EF00DBEFE0 /* event.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = event.c; path = "third-party/libevent/event.c"; sourceTree = "<group>"; };
BE75C35F0C72A0EF00DBEFE0 /* http.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = http.c; path = "third-party/libevent/http.c"; sourceTree = "<group>"; };
BE75C3600C72A0EF00DBEFE0 /* event_tagging.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = event_tagging.c; path = "third-party/libevent/event_tagging.c"; sourceTree = "<group>"; };
BE75C3610C72A0EF00DBEFE0 /* evrpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evrpc.c; path = "third-party/libevent/evrpc.c"; sourceTree = "<group>"; };
BE75C3620C72A0EF00DBEFE0 /* evdns.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evdns.c; path = "third-party/libevent/evdns.c"; sourceTree = "<group>"; };
BE75C3630C72A0EF00DBEFE0 /* poll.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = poll.c; path = "third-party/libevent/poll.c"; sourceTree = "<group>"; };
BE75C3640C72A0EF00DBEFE0 /* select.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = select.c; path = "third-party/libevent/select.c"; sourceTree = "<group>"; };
BE75C3810C72A1C100DBEFE0 /* evhttp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evhttp.h; path = "third-party/libevent/evhttp.h"; sourceTree = "<group>"; };
BE75C3820C72A1C100DBEFE0 /* evdns.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evdns.h; path = "third-party/libevent/evdns.h"; sourceTree = "<group>"; };
BE75C3830C72A1C100DBEFE0 /* evrpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evrpc.h; path = "third-party/libevent/evrpc.h"; sourceTree = "<group>"; };
BE75C3840C72A1C100DBEFE0 /* event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = event.h; path = "third-party/libevent/event.h"; sourceTree = "<group>"; };
BEFC1C000C07750000B0BB3C /* transmission-daemon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "transmission-daemon"; sourceTree = BUILT_PRODUCTS_DIR; };
BEFC1C0E0C07756200B0BB3C /* daemon.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = daemon.c; path = daemon/daemon.c; sourceTree = "<group>"; };
@ -1322,21 +1310,14 @@
children = (
A2BC19DF0CA9D82300DD302A /* evutil.h */,
BE75C3810C72A1C100DBEFE0 /* evhttp.h */,
BE75C3820C72A1C100DBEFE0 /* evdns.h */,
BE75C3830C72A1C100DBEFE0 /* evrpc.h */,
BE75C3840C72A1C100DBEFE0 /* event.h */,
4D36BBC80CA309AA00A63CA5 /* evutil.c */,
BE75C3580C72A0EF00DBEFE0 /* kqueue.c */,
BE75C3590C72A0EF00DBEFE0 /* signal.c */,
BE75C35A0C72A0EF00DBEFE0 /* buffer.c */,
BE75C35B0C72A0EF00DBEFE0 /* log.c */,
BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */,
BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */,
BE75C35E0C72A0EF00DBEFE0 /* event.c */,
BE75C35F0C72A0EF00DBEFE0 /* http.c */,
BE75C3600C72A0EF00DBEFE0 /* event_tagging.c */,
BE75C3610C72A0EF00DBEFE0 /* evrpc.c */,
BE75C3620C72A0EF00DBEFE0 /* evdns.c */,
BE75C3630C72A0EF00DBEFE0 /* poll.c */,
BE75C3640C72A0EF00DBEFE0 /* select.c */,
);
@ -2050,13 +2031,8 @@
BE75C3660C72A0EF00DBEFE0 /* signal.c in Sources */,
BE75C3670C72A0EF00DBEFE0 /* buffer.c in Sources */,
BE75C3680C72A0EF00DBEFE0 /* log.c in Sources */,
BE75C3690C72A0EF00DBEFE0 /* strlcpy.c in Sources */,
BE75C36A0C72A0EF00DBEFE0 /* evbuffer.c in Sources */,
BE75C36B0C72A0EF00DBEFE0 /* event.c in Sources */,
BE75C36C0C72A0EF00DBEFE0 /* http.c in Sources */,
BE75C36D0C72A0EF00DBEFE0 /* event_tagging.c in Sources */,
BE75C36E0C72A0EF00DBEFE0 /* evrpc.c in Sources */,
BE75C36F0C72A0EF00DBEFE0 /* evdns.c in Sources */,
BE75C3700C72A0EF00DBEFE0 /* poll.c in Sources */,
BE75C3710C72A0EF00DBEFE0 /* select.c in Sources */,
4D36BBC90CA309AA00A63CA5 /* evutil.c in Sources */,

View File

@ -8,8 +8,7 @@
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="3166"/>
<integer value="1041"/>
<integer value="3088"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -39,7 +38,7 @@
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{350, 5}</string>
<object class="NSView" key="NSWindowView" id="303120456">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -1983,7 +1982,7 @@ zJLMsszTzPPNFM00zVXNdc2GzabNx83nzgjOKM5JzmnOis6qzrrO2877zxzPPM9dz33Pns++z9/P79AA
<bytes key="NSWhite">MC44MDI0MTkzNgA</bytes>
</object>
<double key="NSRowHeight">6.200000e+01</double>
<int key="NSTvFlags">448823296</int>
<int key="NSTvFlags">440434688</int>
<int key="NSColumnAutoresizingStyle">1</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
@ -2030,6 +2029,7 @@ zJLMsszTzPPNFM00zVXNdc2GzabNx83nzgjOKM5JzmnOis6qzrrO2877zxzPPM9dz33Pns++z9/P79AA
</object>
</object>
<string key="NSFrameSize">{468, 196}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{350, 27}</string>

View File

@ -698,6 +698,72 @@
}
}
//alternating rows - first row after group row is white
- (void) highlightSelectionInClipRect: (NSRect) clipRect
{
NSArray * colors = [NSColor controlAlternatingRowBackgroundColors];
NSRect visibleRect = [self visibleRect];
NSRange rows = [self rowsInRect: visibleRect];
BOOL start = YES;
int i;
if (rows.length > 0)
{
//determine what the first row color should be
if ([[self itemAtRow: rows.location] isKindOfClass: [Torrent class]])
{
for (i = rows.location-1; i>=0; i--)
{
if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
break;
start = !start;
}
}
else
{
rows.location++;
rows.length--;
}
for (i = rows.location; i < NSMaxRange(rows); i++)
{
if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
{
start = YES;
continue;
}
NSColor * color = start ? [colors objectAtIndex: 0] : [colors objectAtIndex: 1];
[color set];
NSRectFill([self rectOfRow: i]);
start = !start;
}
float newY = NSMaxY([self rectOfRow: i-1]);
visibleRect.size.height -= newY - visibleRect.origin.y;
visibleRect.origin.y = newY;
}
//remaining visible rows continue alternating
NSRect rowRect = visibleRect;
rowRect.size.height = [self rowHeight] + [self intercellSpacing].height;
while (rowRect.origin.y < NSMaxY(visibleRect))
{
NSColor * color = start ? [colors objectAtIndex: 0] : [colors objectAtIndex: 1];
[color set];
NSRectFill(rowRect);
start = !start;
rowRect.origin.y += rowRect.size.height;
}
[super highlightSelectionInClipRect: clipRect];
}
- (void) setQuickLimitMode: (id) sender
{
int mode;