Changeset 640


Ignore:
Timestamp:
Jul 19, 2006, 12:06:32 AM (16 years ago)
Author:
livings124
Message:

Dim filter buttons and "turtle" button when the window isn't key.
Larger status bar.
Toggle button for filter bar in status bar (image needed!).
Custom ordering only when filter disabled (even if filtering causes nothing to be hidden).

Location:
trunk
Files:
10 edited

Legend:

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

    r627 r640  
    116116                A27A53570A06A76400E1F16F /* StatusSep.png in Resources */ = {isa = PBXBuildFile; fileRef = A27A53560A06A76400E1F16F /* StatusSep.png */; };
    117117                A27A53660A06AEDB00E1F16F /* StatusBorder.png in Resources */ = {isa = PBXBuildFile; fileRef = A27A53650A06AEDB00E1F16F /* StatusBorder.png */; };
    118                 A27ABC230A6ADE410020EC71 /* ImageBackgroundView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A27ABC210A6ADE410020EC71 /* ImageBackgroundView.h */; };
    119118                A27ABC240A6ADE410020EC71 /* ImageBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = A27ABC220A6ADE410020EC71 /* ImageBackgroundView.m */; };
    120119                A27ABC8B0A6B317D0020EC71 /* CloseCircleButton.png in Resources */ = {isa = PBXBuildFile; fileRef = A27ABC890A6B317D0020EC71 /* CloseCircleButton.png */; };
     
    159158                                A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */,
    160159                                A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */,
    161                                 A27ABC230A6ADE410020EC71 /* ImageBackgroundView.h in CopyFiles */,
    162160                        );
    163161                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/BarButton.h

    r600 r640  
    2727@interface BarButton : NSImageView
    2828{
    29     NSImage * fButtonNormal, * fButtonOver, * fButtonPressed, * fButtonSelected;
     29    NSImage * fButtonNormal, * fButtonNormalDim, * fButtonOver,
     30            * fButtonPressed, * fButtonSelected, * fButtonSelectedDim;
    3031
    3132    BOOL fEnabled;
     
    3839- (void) resetBounds: (NSNotification *) notification;
    3940
     41- (void) setForActive;
     42- (void) setForInactive;
     43
    4044@end
  • trunk/macosx/BarButton.m

    r638 r640  
    3737        NSSize buttonSize = [self frame].size;
    3838        fButtonNormal = [[NSImage alloc] initWithSize: buttonSize];
     39        fButtonNormalDim = [[NSImage alloc] initWithSize: buttonSize];
    3940        fButtonOver = [[NSImage alloc] initWithSize: buttonSize];
    4041        fButtonPressed = [[NSImage alloc] initWithSize: buttonSize];
    4142        fButtonSelected = [[NSImage alloc] initWithSize: buttonSize];
     43        fButtonSelectedDim = [[NSImage alloc] initWithSize: buttonSize];
    4244       
    4345        //rolled over button
     
    8991        [fButtonSelected unlockFocus];
    9092       
     93        //selected and dimmed button
     94        fButtonSelectedDim = [fButtonSelected copy];
     95       
    9196        [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resetBounds:)
    9297                    name: NSViewBoundsDidChangeNotification object: nil];
     
    101106    [fButtonPressed release];
    102107    [fButtonSelected release];
     108    [fButtonSelectedDim release];
    103109   
    104110    [super dealloc];
     
    108114- (void) setText: (NSString *) text
    109115{
    110     NSDictionary * normalAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    111                 [NSColor blackColor], NSForegroundColorAttributeName,
    112                 [NSFont fontWithName: @"Lucida Grande" size: 12.0], NSFontAttributeName, nil];
    113    
    114116    NSFont * boldFont = [[NSFontManager sharedFontManager] convertFont:
    115117                            [NSFont fontWithName: @"Lucida Grande" size: 12.0] toHaveTrait: NSBoldFontMask];
    116118   
    117     NSDictionary * highlightedAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
     119    NSDictionary * normalAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
     120                [NSColor controlTextColor], NSForegroundColorAttributeName,
     121                [NSFont fontWithName: @"Lucida Grande" size: 12.0], NSFontAttributeName, nil],
     122        * normalDimAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
     123                [NSColor disabledControlTextColor], NSForegroundColorAttributeName,
     124                [NSFont fontWithName: @"Lucida Grande" size: 12.0], NSFontAttributeName, nil],
     125        * highlightedAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    118126                [NSColor whiteColor], NSForegroundColorAttributeName,
     127                boldFont, NSFontAttributeName, nil],
     128        * highlightedDimAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
     129                [NSColor colorWithCalibratedRed: 0.9 green: 0.9 blue: 0.9 alpha: 1.0], NSForegroundColorAttributeName,
    119130                boldFont, NSFontAttributeName, nil];
    120131   
     
    133144    [fButtonNormal unlockFocus];
    134145   
     146    //normal and dim button
     147    [fButtonNormalDim lockFocus];
     148    [text drawInRect: textRectNormal withAttributes: normalDimAttributes];
     149    [fButtonNormalDim unlockFocus];
     150   
    135151    //rolled over button
    136152    [fButtonOver lockFocus];
     
    148164    [fButtonSelected unlockFocus];
    149165   
     166    //selected and dim button
     167    [fButtonSelectedDim lockFocus];
     168    [text drawInRect: textRectBold withAttributes: highlightedDimAttributes];
     169    [fButtonSelectedDim unlockFocus];
     170   
    150171    [self setImage: fButtonNormal];
    151172   
    152173    [normalAttributes release];
     174    [normalDimAttributes release];
    153175    [highlightedAttributes release];
     176    [highlightedDimAttributes release];
    154177   
    155178    //NSLog(@"%@ %f", text, textSizeBold.width);
     
    199222}
    200223
     224- (void) setForActive
     225{
     226    if ([self image] == fButtonSelectedDim)
     227        [self setImage: fButtonSelected];
     228    else if ([self image] == fButtonNormalDim)
     229        [self setImage: fButtonNormal];
     230    else;
     231   
     232    [self resetBounds: nil];
     233}
     234
     235- (void) setForInactive
     236{
     237    [self setImage: [self image] == fButtonSelected ? fButtonSelectedDim : fButtonNormalDim];
     238   
     239    if (fTrackingTag)
     240        [self removeTrackingRect: fTrackingTag];
     241}
     242
    201243@end
  • trunk/macosx/Controller.h

    r624 r640  
    5959    BOOL                            fStatusBarVisible;
    6060    IBOutlet NSTextField            * fTotalDLField, * fTotalULField, * fTotalTorrentsField;
     61    IBOutlet NSButton               * fShowFilterButton;
    6162   
    6263    NSString                        * fSortType;
  • trunk/macosx/Controller.m

    r638 r640  
    103103    [fPrefsController setPrefs: fLib];
    104104   
     105    #warning remove eventually
     106    NSImage * image = [NSImage imageNamed: @"StatusBorder.png"];
     107    [image setName: nil];
    105108    [fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBorder.png"]];
    106109    [fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
     
    229232    [fPauseFilterButton setText: @"Paused"]; //44.06
    230233
    231     NSMenuItem * currentFilterItem;
    232234    BarButton * currentFilterButton;
    233235    if ([fFilterType isEqualToString: @"Pause"])
     
    527529}
    528530
    529 - (void) openSheetClosed: (NSOpenPanel *) panel returnCode: (int) code
    530     contextInfo: (void *) info
     531- (void) openSheetClosed: (NSOpenPanel *) panel returnCode: (int) code contextInfo: (void *) info
    531532{
    532533    if (code == NSOKButton)
     
    550551}
    551552
    552 - (void) resumeTorrents: (NSArray *) torrents;
     553- (void) resumeTorrents: (NSArray *) torrents
    553554{
    554555    [torrents makeObjectsPerformSelector: @selector(startTransfer)];
     
    570571}
    571572
    572 - (void) stopTorrents: (NSArray *) torrents;
     573- (void) stopTorrents: (NSArray *) torrents
    573574{
    574575    //don't want any of these starting then stopping
     
    833834- (void) updateControlTint: (NSNotification *) notification
    834835{
    835     [fSpeedLimitButton setAlternateImage: [fDefaults integerForKey: @"AppleAquaColorVariant"] == NSBlueControlTint
     836    if ([fWindow isKeyWindow])
     837        [fSpeedLimitButton setAlternateImage: [NSColor currentControlTint] == NSBlueControlTint
    836838            ? [NSImage imageNamed: @"SpeedLimitButtonPressedBlue.png"]
    837839            : [NSImage imageNamed: @"SpeedLimitButtonPressedGraphite.png"]];
     
    870872    if (fStatusBarVisible)
    871873    {
    872         [fTotalDLField setStringValue: [NSString stringForSpeed: downloadRate]];
    873         [fTotalULField setStringValue: [NSString stringForSpeed: uploadRate]];
     874        [fTotalDLField setStringValue: [@"Total DL: " stringByAppendingString: [NSString stringForSpeed: downloadRate]]];
     875        [fTotalULField setStringValue: [@"Total UL: " stringByAppendingString: [NSString stringForSpeed: uploadRate]]];
    874876    }
    875877
     
    13901392{
    13911393    //only allow reordering of rows if sorting by order with no filter
    1392     if ([fSortType isEqualToString: @"Order"] && [fTorrents count] == [fFilteredTorrents count])
     1394    if ([fSortType isEqualToString: @"Order"] && [fFilterType isEqualToString: @"None"]
     1395            && [[fSearchFilterField stringValue] isEqualToString: @""])
    13931396    {
    13941397        [pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self];
     
    16321635    if (!show)
    16331636        [fWindow makeFirstResponder: fTableView];
     1637   
     1638    //enable show filter button in status bar
     1639    [fShowFilterButton setEnabled: !show];
    16341640   
    16351641    //reset tracking rects for filter buttons
     
    20442050- (void) windowDidBecomeKey: (NSNotification *) notification
    20452051{
    2046     fCompleted = 0;
     2052    //reset dock badge for completed
     2053    if (fCompleted > 0)
     2054    {
     2055        fCompleted = 0;
     2056        [self updateUI: nil];
     2057    }
     2058   
     2059    //set status fields inactive color
     2060    /*NSColor * enabledColor = [NSColor controlTextColor];
     2061    [fTotalTorrentsField setTextColor: enabledColor];
     2062    [fTotalDLField setTextColor: enabledColor];
     2063    [fTotalULField setTextColor: enabledColor];*/
     2064   
     2065    //set filter images as active
     2066    [fNoFilterButton setForActive];
     2067    [fSeedFilterButton setForActive];
     2068    [fDownloadFilterButton setForActive];
     2069    [fPauseFilterButton setForActive];
     2070   
     2071    [fSpeedLimitButton setAlternateImage: [NSColor currentControlTint] == NSBlueControlTint
     2072            ? [NSImage imageNamed: @"SpeedLimitButtonPressedBlue.png"]
     2073            : [NSImage imageNamed: @"SpeedLimitButtonPressedGraphite.png"]];
     2074}
     2075
     2076- (void) windowDidResignKey: (NSNotification *) notification
     2077{
     2078    //set status fields inactive color
     2079    /*NSColor * disabledColor = [NSColor disabledControlTextColor];
     2080    [fTotalTorrentsField setTextColor: disabledColor];
     2081    [fTotalDLField setTextColor: disabledColor];
     2082    [fTotalULField setTextColor: disabledColor];*/
     2083
     2084    //set filter images as inactive
     2085    [fNoFilterButton setForInactive];
     2086    [fSeedFilterButton setForInactive];
     2087    [fDownloadFilterButton setForInactive];
     2088    [fPauseFilterButton setForInactive];
     2089   
     2090    #warning need real inactive image
     2091    [fSpeedLimitButton setAlternateImage: [NSImage imageNamed: @"SpeedLimitButton.png"]];
    20472092}
    20482093
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r625 r640  
    5858                fSearchFilterField = NSSearchField;
    5959                fSeedFilterButton = BarButton;
     60                fShowFilterButton = NSButton;
    6061                fSmallViewItem = NSMenuItem;
    6162                fSpeedLimitButton = NSButton;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r638 r640  
    1010                <string>344 478 208 99 0 0 1152 842 </string>
    1111                <key>1480</key>
    12                 <string>364 490 420 60 0 0 1152 842 </string>
     12                <string>310 355 420 63 0 0 1152 842 </string>
    1313                <key>1603</key>
    1414                <string>337 544 477 67 0 0 1152 842 </string>
     
    3232        <key>IBOpenObjects</key>
    3333        <array>
     34                <integer>1603</integer>
     35                <integer>1480</integer>
    3436                <integer>29</integer>
    35                 <integer>1603</integer>
    3637        </array>
    3738        <key>IBSystem Version</key>
  • trunk/macosx/ImageBackgroundView.m

    r639 r640  
    3131    if (fBackgroundColor)
    3232        [fBackgroundColor release];
    33    
    3433    fBackgroundColor = [[NSColor colorWithPatternImage: image] retain];
    3534}
Note: See TracChangeset for help on using the changeset viewer.