Changeset 591


Ignore:
Timestamp:
Jul 15, 2006, 9:34:15 PM (16 years ago)
Author:
livings124
Message:

Use images for filter buttons.

Location:
trunk
Files:
9 added
5 edited

Legend:

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

    r589 r591  
    9898                A2519D490A2FADFC00479D0C /* SmoothAquaView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2519D470A2FADFC00479D0C /* SmoothAquaView.m */; };
    9999                A253F6F30A698970008EE24F /* FilterBarBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F6F20A698970008EE24F /* FilterBarBackground.png */; };
     100                A253F70B0A6990EB008EE24F /* FilterButtonOverMain.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7080A6990EB008EE24F /* FilterButtonOverMain.png */; };
     101                A253F70C0A6990EB008EE24F /* FilterButtonOverLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7090A6990EB008EE24F /* FilterButtonOverLeft.png */; };
     102                A253F70D0A6990EB008EE24F /* FilterButtonOverRight.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F70A0A6990EB008EE24F /* FilterButtonOverRight.png */; };
     103                A253F7150A699178008EE24F /* FilterButtonPressedRight.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7120A699178008EE24F /* FilterButtonPressedRight.png */; };
     104                A253F7160A699178008EE24F /* FilterButtonPressedMain.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7130A699178008EE24F /* FilterButtonPressedMain.png */; };
     105                A253F7170A699178008EE24F /* FilterButtonPressedLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7140A699178008EE24F /* FilterButtonPressedLeft.png */; };
     106                A253F72A0A699373008EE24F /* FilterButtonSelectedLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7270A699373008EE24F /* FilterButtonSelectedLeft.png */; };
     107                A253F72B0A699373008EE24F /* FilterButtonSelectedMain.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7280A699373008EE24F /* FilterButtonSelectedMain.png */; };
     108                A253F72C0A699373008EE24F /* FilterButtonSelectedRight.png in Resources */ = {isa = PBXBuildFile; fileRef = A253F7290A699373008EE24F /* FilterButtonSelectedRight.png */; };
    100109                A25FCDDF0A37695F002BCBBE /* PauseSelected.png in CopyFiles */ = {isa = PBXBuildFile; fileRef = A25FCDDD0A37695F002BCBBE /* PauseSelected.png */; };
    101110                A25FCDE00A37695F002BCBBE /* ResumeSelected.png in CopyFiles */ = {isa = PBXBuildFile; fileRef = A25FCDDE0A37695F002BCBBE /* ResumeSelected.png */; };
     
    288297                A2519D480A2FADFC00479D0C /* SmoothAquaView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SmoothAquaView.h; path = macosx/SmoothAquaView.h; sourceTree = "<group>"; };
    289298                A253F6F20A698970008EE24F /* FilterBarBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterBarBackground.png; path = macosx/Images/FilterBarBackground.png; sourceTree = "<group>"; };
     299                A253F7080A6990EB008EE24F /* FilterButtonOverMain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonOverMain.png; path = macosx/Images/FilterButtonOverMain.png; sourceTree = "<group>"; };
     300                A253F7090A6990EB008EE24F /* FilterButtonOverLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonOverLeft.png; path = macosx/Images/FilterButtonOverLeft.png; sourceTree = "<group>"; };
     301                A253F70A0A6990EB008EE24F /* FilterButtonOverRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonOverRight.png; path = macosx/Images/FilterButtonOverRight.png; sourceTree = "<group>"; };
     302                A253F7120A699178008EE24F /* FilterButtonPressedRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonPressedRight.png; path = macosx/Images/FilterButtonPressedRight.png; sourceTree = "<group>"; };
     303                A253F7130A699178008EE24F /* FilterButtonPressedMain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonPressedMain.png; path = macosx/Images/FilterButtonPressedMain.png; sourceTree = "<group>"; };
     304                A253F7140A699178008EE24F /* FilterButtonPressedLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonPressedLeft.png; path = macosx/Images/FilterButtonPressedLeft.png; sourceTree = "<group>"; };
     305                A253F7270A699373008EE24F /* FilterButtonSelectedLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonSelectedLeft.png; path = macosx/Images/FilterButtonSelectedLeft.png; sourceTree = "<group>"; };
     306                A253F7280A699373008EE24F /* FilterButtonSelectedMain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonSelectedMain.png; path = macosx/Images/FilterButtonSelectedMain.png; sourceTree = "<group>"; };
     307                A253F7290A699373008EE24F /* FilterButtonSelectedRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FilterButtonSelectedRight.png; path = macosx/Images/FilterButtonSelectedRight.png; sourceTree = "<group>"; };
    290308                A25FCDDD0A37695F002BCBBE /* PauseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseSelected.png; path = macosx/Images/PauseSelected.png; sourceTree = "<group>"; };
    291309                A25FCDDE0A37695F002BCBBE /* ResumeSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeSelected.png; path = macosx/Images/ResumeSelected.png; sourceTree = "<group>"; };
     
    455473                                A27A53650A06AEDB00E1F16F /* StatusBorder.png */,
    456474                                A253F6F20A698970008EE24F /* FilterBarBackground.png */,
     475                                A253F7080A6990EB008EE24F /* FilterButtonOverMain.png */,
     476                                A253F7090A6990EB008EE24F /* FilterButtonOverLeft.png */,
     477                                A253F70A0A6990EB008EE24F /* FilterButtonOverRight.png */,
     478                                A253F7120A699178008EE24F /* FilterButtonPressedRight.png */,
     479                                A253F7130A699178008EE24F /* FilterButtonPressedMain.png */,
     480                                A253F7140A699178008EE24F /* FilterButtonPressedLeft.png */,
     481                                A253F7270A699373008EE24F /* FilterButtonSelectedLeft.png */,
     482                                A253F7280A699373008EE24F /* FilterButtonSelectedMain.png */,
     483                                A253F7290A699373008EE24F /* FilterButtonSelectedRight.png */,
    457484                                A2912C520A2956E80097A0CA /* PrefsWindow.nib */,
    458485                        );
     
    709736                                A20AB97B0A5C622A004F81FA /* SmallTurtle.png in Resources */,
    710737                                A253F6F30A698970008EE24F /* FilterBarBackground.png in Resources */,
     738                                A253F70B0A6990EB008EE24F /* FilterButtonOverMain.png in Resources */,
     739                                A253F70C0A6990EB008EE24F /* FilterButtonOverLeft.png in Resources */,
     740                                A253F70D0A6990EB008EE24F /* FilterButtonOverRight.png in Resources */,
     741                                A253F7150A699178008EE24F /* FilterButtonPressedRight.png in Resources */,
     742                                A253F7160A699178008EE24F /* FilterButtonPressedMain.png in Resources */,
     743                                A253F7170A699178008EE24F /* FilterButtonPressedLeft.png in Resources */,
     744                                A253F72A0A699373008EE24F /* FilterButtonSelectedLeft.png in Resources */,
     745                                A253F72B0A699373008EE24F /* FilterButtonSelectedMain.png in Resources */,
     746                                A253F72C0A699373008EE24F /* FilterButtonSelectedRight.png in Resources */,
    711747                        );
    712748                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/BarButton.h

    r590 r591  
    2727@interface BarButton : NSImageView
    2828{
    29     NSImage * fButtonNormal, * fButtonIn, * fButtonDown;
     29    NSImage * fButtonNormal, * fButtonOver, * fButtonPressed, * fButtonSelected;
    3030
    3131    NSString * fPrefString, * fPrefKey;
  • trunk/macosx/BarButton.m

    r590 r591  
    2727@implementation BarButton
    2828
     29//height of button should be made 17.0
    2930- (id) initWithCoder: (NSCoder *) coder
    3031{
     
    3536        NSSize buttonSize = [self frame].size;
    3637        fButtonNormal = [[NSImage alloc] initWithSize: buttonSize];
    37         fButtonIn = [[NSImage alloc] initWithSize: buttonSize];
    38         fButtonDown = [[NSImage alloc] initWithSize: buttonSize];
     38        fButtonOver = [[NSImage alloc] initWithSize: buttonSize];
     39        fButtonPressed = [[NSImage alloc] initWithSize: buttonSize];
     40        fButtonSelected = [[NSImage alloc] initWithSize: buttonSize];
    3941       
    4042        //create shape
     
    4850                NSMakeRect(ovalDiamater * 0.5, 0, buttonSize.width - ovalDiamater, buttonSize.height)];
    4951       
    50         //create highlighted button
    51         [fButtonIn lockFocus];
    52         [[NSColor colorWithCalibratedRed: 0.4941 green: 0.5647 blue: 0.6706 alpha: 1.0] set];
    53         [rect fill];
    54         [fButtonIn unlockFocus];
    55        
    56         //create pushed button
    57         [fButtonDown lockFocus];
    58         [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.6] set];
    59         [rect fill];
    60         [fButtonDown unlockFocus];
     52        //create rolled over button
     53        NSImage * leftOver = [NSImage imageNamed: @"FilterButtonOverLeft.png"],
     54                * rightOver = [NSImage imageNamed: @"FilterButtonOverRight.png"],
     55                * mainOver = [NSImage imageNamed: @"FilterButtonOverMain.png"];
     56       
     57        float endWidth = [leftOver size].width,
     58                mainWidth = buttonSize.width - 2.0 * endWidth;
     59        NSPoint leftPoint = NSMakePoint(0, 0),
     60                mainPoint = NSMakePoint(endWidth, 0),
     61                rightPoint = NSMakePoint(mainWidth + endWidth, 0);
     62        NSSize mainSize = NSMakeSize(mainWidth, [leftOver size].height);
     63
     64        [mainOver setScalesWhenResized: YES];
     65        [mainOver setSize: mainSize];
     66       
     67        [fButtonOver lockFocus];
     68        [leftOver compositeToPoint: leftPoint operation: NSCompositeSourceOver];
     69        [mainOver compositeToPoint: mainPoint operation: NSCompositeSourceOver];
     70        [rightOver compositeToPoint: rightPoint operation: NSCompositeSourceOver];
     71        [fButtonOver unlockFocus];
     72       
     73        //create pressed button
     74        NSImage * leftPressed = [NSImage imageNamed: @"FilterButtonPressedLeft.png"],
     75                * rightPressed = [NSImage imageNamed: @"FilterButtonPressedRight.png"],
     76                * mainPressed = [NSImage imageNamed: @"FilterButtonPressedMain.png"];
     77       
     78        [mainPressed setScalesWhenResized: YES];
     79        [mainPressed setSize: mainSize];
     80       
     81        [fButtonPressed lockFocus];
     82        [leftPressed compositeToPoint: leftPoint operation: NSCompositeSourceOver];
     83        [mainPressed compositeToPoint: mainPoint operation: NSCompositeSourceOver];
     84        [rightPressed compositeToPoint: rightPoint operation: NSCompositeSourceOver];
     85        [fButtonPressed unlockFocus];
     86       
     87        //create selected button
     88        NSImage * leftSelected = [NSImage imageNamed: @"FilterButtonSelectedLeft.png"],
     89                * rightSelected = [NSImage imageNamed: @"FilterButtonSelectedRight.png"],
     90                * mainSelected = [NSImage imageNamed: @"FilterButtonSelectedMain.png"];
     91       
     92        [mainSelected setScalesWhenResized: YES];
     93        [mainSelected setSize: mainSize];
     94       
     95        [fButtonSelected lockFocus];
     96        [leftSelected compositeToPoint: leftPoint operation: NSCompositeSourceOver];
     97        [mainSelected compositeToPoint: mainPoint operation: NSCompositeSourceOver];
     98        [rightSelected compositeToPoint: rightPoint operation: NSCompositeSourceOver];
     99        [fButtonSelected unlockFocus];
    61100       
    62101        [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resetBounds:)
     
    74113{
    75114    [fButtonNormal release];
    76     [fButtonIn release];
    77     [fButtonDown release];
     115    [fButtonOver release];
     116    [fButtonPressed release];
     117    [fButtonSelected release];
    78118   
    79119    [super dealloc];
     
    108148    [fButtonNormal unlockFocus];
    109149   
    110     //create highlighted button
    111     [fButtonIn lockFocus];
     150    //create rolled over button
     151    [fButtonOver lockFocus];
    112152    [text drawInRect: textRect withAttributes: highlightedAttributes];
    113     [fButtonIn unlockFocus];
    114    
    115     //create pushed button
    116     [fButtonDown lockFocus];
     153    [fButtonOver unlockFocus];
     154   
     155    //create pressed button
     156    [fButtonPressed lockFocus];
    117157    [text drawInRect: textRect withAttributes: highlightedAttributes];
    118     [fButtonDown unlockFocus];
     158    [fButtonPressed unlockFocus];
     159   
     160    //create selected button
     161    [fButtonSelected lockFocus];
     162    [text drawInRect: textRect withAttributes: highlightedAttributes];
     163    [fButtonSelected unlockFocus];
    119164   
    120165    [self setImage: fButtonNormal];
     
    127172{
    128173    if (!fEnabled)
    129         [self setImage: fButtonIn];
     174        [self setImage: fButtonOver];
    130175
    131176    [super mouseEntered: event];
     
    142187- (void) mouseDown: (NSEvent *) event
    143188{
    144     [self setImage: fButtonDown];
     189    [self setImage: fButtonPressed];
    145190
    146191    [super mouseDown: event];
     
    151196        [NSApp sendAction: [self action] to: [self target] from: self];
    152197   
    153     [self setImage: fButtonIn];
     198    [self setImage: fEnabled ? fButtonSelected : fButtonOver];
    154199}
    155200
     
    157202{
    158203    fEnabled = enable;
    159     [self setImage: fEnabled ? fButtonIn : fButtonNormal];
     204    [self setImage: fEnabled ? fButtonSelected : fButtonNormal];
    160205}
    161206
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r582 r591  
    1212                <string>364 490 420 60 0 0 1152 842 </string>
    1313                <key>1603</key>
    14                 <string>337 545 477 66 0 0 1152 842 </string>
     14                <string>74 585 477 66 0 0 1152 842 </string>
    1515                <key>29</key>
    1616                <string>9 780 451 44 0 0 1152 842 </string>
Note: See TracChangeset for help on using the changeset viewer.