Changeset 5918


Ignore:
Timestamp:
May 23, 2008, 7:04:19 PM (14 years ago)
Author:
livings124
Message:

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

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r5915 r5918  
    259259                BE75C3670C72A0EF00DBEFE0 /* buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35A0C72A0EF00DBEFE0 /* buffer.c */; };
    260260                BE75C3680C72A0EF00DBEFE0 /* log.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35B0C72A0EF00DBEFE0 /* log.c */; };
    261                 BE75C3690C72A0EF00DBEFE0 /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */; };
    262261                BE75C36A0C72A0EF00DBEFE0 /* evbuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */; };
    263262                BE75C36B0C72A0EF00DBEFE0 /* event.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35E0C72A0EF00DBEFE0 /* event.c */; };
    264                 BE75C36C0C72A0EF00DBEFE0 /* http.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C35F0C72A0EF00DBEFE0 /* http.c */; };
    265                 BE75C36D0C72A0EF00DBEFE0 /* event_tagging.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3600C72A0EF00DBEFE0 /* event_tagging.c */; };
    266                 BE75C36E0C72A0EF00DBEFE0 /* evrpc.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3610C72A0EF00DBEFE0 /* evrpc.c */; };
    267                 BE75C36F0C72A0EF00DBEFE0 /* evdns.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3620C72A0EF00DBEFE0 /* evdns.c */; };
    268263                BE75C3700C72A0EF00DBEFE0 /* poll.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3630C72A0EF00DBEFE0 /* poll.c */; };
    269264                BE75C3710C72A0EF00DBEFE0 /* select.c in Sources */ = {isa = PBXBuildFile; fileRef = BE75C3640C72A0EF00DBEFE0 /* select.c */; };
     
    739734                BE75C35A0C72A0EF00DBEFE0 /* buffer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = buffer.c; path = "third-party/libevent/buffer.c"; sourceTree = "<group>"; };
    740735                BE75C35B0C72A0EF00DBEFE0 /* log.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = log.c; path = "third-party/libevent/log.c"; sourceTree = "<group>"; };
    741                 BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = "third-party/libevent/strlcpy.c"; sourceTree = "<group>"; };
    742736                BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evbuffer.c; path = "third-party/libevent/evbuffer.c"; sourceTree = "<group>"; };
    743737                BE75C35E0C72A0EF00DBEFE0 /* event.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = event.c; path = "third-party/libevent/event.c"; sourceTree = "<group>"; };
    744                 BE75C35F0C72A0EF00DBEFE0 /* http.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = http.c; path = "third-party/libevent/http.c"; sourceTree = "<group>"; };
    745                 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>"; };
    746                 BE75C3610C72A0EF00DBEFE0 /* evrpc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evrpc.c; path = "third-party/libevent/evrpc.c"; sourceTree = "<group>"; };
    747                 BE75C3620C72A0EF00DBEFE0 /* evdns.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = evdns.c; path = "third-party/libevent/evdns.c"; sourceTree = "<group>"; };
    748738                BE75C3630C72A0EF00DBEFE0 /* poll.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = poll.c; path = "third-party/libevent/poll.c"; sourceTree = "<group>"; };
    749739                BE75C3640C72A0EF00DBEFE0 /* select.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = select.c; path = "third-party/libevent/select.c"; sourceTree = "<group>"; };
    750740                BE75C3810C72A1C100DBEFE0 /* evhttp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evhttp.h; path = "third-party/libevent/evhttp.h"; sourceTree = "<group>"; };
    751                 BE75C3820C72A1C100DBEFE0 /* evdns.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evdns.h; path = "third-party/libevent/evdns.h"; sourceTree = "<group>"; };
    752                 BE75C3830C72A1C100DBEFE0 /* evrpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = evrpc.h; path = "third-party/libevent/evrpc.h"; sourceTree = "<group>"; };
    753741                BE75C3840C72A1C100DBEFE0 /* event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = event.h; path = "third-party/libevent/event.h"; sourceTree = "<group>"; };
    754742                BEFC1C000C07750000B0BB3C /* transmission-daemon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "transmission-daemon"; sourceTree = BUILT_PRODUCTS_DIR; };
     
    13231311                                A2BC19DF0CA9D82300DD302A /* evutil.h */,
    13241312                                BE75C3810C72A1C100DBEFE0 /* evhttp.h */,
    1325                                 BE75C3820C72A1C100DBEFE0 /* evdns.h */,
    1326                                 BE75C3830C72A1C100DBEFE0 /* evrpc.h */,
    13271313                                BE75C3840C72A1C100DBEFE0 /* event.h */,
    13281314                                4D36BBC80CA309AA00A63CA5 /* evutil.c */,
     
    13311317                                BE75C35A0C72A0EF00DBEFE0 /* buffer.c */,
    13321318                                BE75C35B0C72A0EF00DBEFE0 /* log.c */,
    1333                                 BE75C35C0C72A0EF00DBEFE0 /* strlcpy.c */,
    13341319                                BE75C35D0C72A0EF00DBEFE0 /* evbuffer.c */,
    13351320                                BE75C35E0C72A0EF00DBEFE0 /* event.c */,
    1336                                 BE75C35F0C72A0EF00DBEFE0 /* http.c */,
    1337                                 BE75C3600C72A0EF00DBEFE0 /* event_tagging.c */,
    1338                                 BE75C3610C72A0EF00DBEFE0 /* evrpc.c */,
    1339                                 BE75C3620C72A0EF00DBEFE0 /* evdns.c */,
    13401321                                BE75C3630C72A0EF00DBEFE0 /* poll.c */,
    13411322                                BE75C3640C72A0EF00DBEFE0 /* select.c */,
     
    20512032                                BE75C3670C72A0EF00DBEFE0 /* buffer.c in Sources */,
    20522033                                BE75C3680C72A0EF00DBEFE0 /* log.c in Sources */,
    2053                                 BE75C3690C72A0EF00DBEFE0 /* strlcpy.c in Sources */,
    20542034                                BE75C36A0C72A0EF00DBEFE0 /* evbuffer.c in Sources */,
    20552035                                BE75C36B0C72A0EF00DBEFE0 /* event.c in Sources */,
    2056                                 BE75C36C0C72A0EF00DBEFE0 /* http.c in Sources */,
    2057                                 BE75C36D0C72A0EF00DBEFE0 /* event_tagging.c in Sources */,
    2058                                 BE75C36E0C72A0EF00DBEFE0 /* evrpc.c in Sources */,
    2059                                 BE75C36F0C72A0EF00DBEFE0 /* evdns.c in Sources */,
    20602036                                BE75C3700C72A0EF00DBEFE0 /* poll.c in Sources */,
    20612037                                BE75C3710C72A0EF00DBEFE0 /* select.c in Sources */,
  • trunk/macosx/English.lproj/MainMenu.xib

    r5878 r5918  
    99                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
    1010                        <bool key="EncodedWithXMLCoder">YES</bool>
    11                         <integer value="3166"/>
    12                         <integer value="1041"/>
     11                        <integer value="3088"/>
    1312                </object>
    1413                <object class="NSArray" key="IBDocument.PluginDependencies">
     
    4039                                <string key="NSWindowContentMinSize">{350, 5}</string>
    4140                                <object class="NSView" key="NSWindowView" id="303120456">
    42                                         <nil key="NSNextResponder"/>
     41                                        <reference key="NSNextResponder"/>
    4342                                        <int key="NSvFlags">256</int>
    4443                                        <object class="NSMutableArray" key="NSSubviews">
     
    19841983                                                                                        </object>
    19851984                                                                                        <double key="NSRowHeight">6.200000e+01</double>
    1986                                                                                         <int key="NSTvFlags">448823296</int>
     1985                                                                                        <int key="NSTvFlags">440434688</int>
    19871986                                                                                        <int key="NSColumnAutoresizingStyle">1</int>
    19881987                                                                                        <int key="NSDraggingSourceMaskForLocal">15</int>
     
    20312030                                        </object>
    20322031                                        <string key="NSFrameSize">{468, 196}</string>
     2032                                        <reference key="NSSuperview"/>
    20332033                                </object>
    20342034                                <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
  • trunk/macosx/TorrentTableView.m

    r5915 r5918  
    699699}
    700700
     701//alternating rows - first row after group row is white
     702- (void) highlightSelectionInClipRect: (NSRect) clipRect
     703{
     704    NSArray * colors = [NSColor controlAlternatingRowBackgroundColors];
     705   
     706    NSRect visibleRect = [self visibleRect];
     707    NSRange rows = [self rowsInRect: visibleRect];
     708   
     709    BOOL start = YES;
     710    int i;
     711   
     712    if (rows.length > 0)
     713    {
     714        //determine what the first row color should be
     715        if ([[self itemAtRow: rows.location] isKindOfClass: [Torrent class]])
     716        {
     717            for (i = rows.location-1; i>=0; i--)
     718            {
     719                if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
     720                    break;
     721                start = !start;
     722            }
     723        }
     724        else
     725        {
     726            rows.location++;
     727            rows.length--;
     728        }
     729       
     730        for (i = rows.location; i < NSMaxRange(rows); i++)
     731        {
     732            if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
     733            {
     734                start = YES;
     735                continue;
     736            }
     737           
     738            NSColor * color = start ? [colors objectAtIndex: 0] : [colors objectAtIndex: 1];
     739            [color set];
     740            NSRectFill([self rectOfRow: i]);
     741           
     742            start = !start;
     743        }
     744       
     745        float newY = NSMaxY([self rectOfRow: i-1]);
     746        visibleRect.size.height -= newY - visibleRect.origin.y;
     747        visibleRect.origin.y = newY;
     748    }
     749   
     750    //remaining visible rows continue alternating
     751    NSRect rowRect = visibleRect;
     752    rowRect.size.height = [self rowHeight] + [self intercellSpacing].height;
     753   
     754    while (rowRect.origin.y < NSMaxY(visibleRect))
     755    {
     756        NSColor * color = start ? [colors objectAtIndex: 0] : [colors objectAtIndex: 1];
     757        [color set];
     758        NSRectFill(rowRect);
     759       
     760        start = !start;
     761        rowRect.origin.y += rowRect.size.height;
     762    }
     763   
     764    [super highlightSelectionInClipRect: clipRect];
     765}
     766
    701767- (void) setQuickLimitMode: (id) sender
    702768{
Note: See TracChangeset for help on using the changeset viewer.