Changeset 1087 for trunk/macosx


Ignore:
Timestamp:
Nov 13, 2006, 5:18:20 PM (15 years ago)
Author:
livings124
Message:

more consistent dock badging

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.h

    r1055 r1087  
    3131
    3232    NSImage         * fDockIcon, * fBadge, * fUploadBadge, * fDownloadBadge;
    33                    
    3433    NSDictionary    * fAttributes;
    35     BOOL            fNonDefault;
    3634}
    3735
  • trunk/macosx/Badger.m

    r1055 r1087  
    3838    if ((self = [super init]))
    3939    {
     40        fDockIcon = [[NSApp applicationIconImage] copy];
    4041        fBadge = [NSImage imageNamed: @"Badge"];
    41         fDockIcon = [[NSApp applicationIconImage] copy];
    4242        fUploadBadge = [NSImage imageNamed: @"UploadBadge"];
    4343        fDownloadBadge = [NSImage imageNamed: @"DownloadBadge"];
     
    5555       
    5656        [stringShadow release];
    57        
    58         fNonDefault = NO;
    5957    }
    6058   
     
    7270- (void) updateBadgeWithCompleted: (int) completed uploadRate: (float) uploadRate downloadRate: (float) downloadRate
    7371{
     72    NSImage * dockIcon;
    7473    NSSize iconSize = [fDockIcon size];
    75 
    76     NSImage * dockIcon = nil;
    7774       
    7875    //set completed badge to top right
     
    109106                                    ? [NSString stringForSpeedAbbrev: downloadRate] : nil;
    110107   
    111     BOOL speedShown = uploadRateString || downloadRateString;
    112     if (speedShown)
     108    if (uploadRateString || downloadRateString)
    113109    {
    114110        if (!dockIcon)
     
    156152    }
    157153   
    158     if (fNonDefault || dockIcon)
    159     {
    160         if (!dockIcon)
    161         {
    162             fNonDefault = NO;
    163             dockIcon = [fDockIcon retain];
    164         }
    165         else
    166             fNonDefault = YES;
    167        
    168         [NSApp setApplicationIconImage: dockIcon];
    169         [dockIcon release];
    170     }
     154    //update dock badge
     155    if (!dockIcon)
     156        dockIcon = [fDockIcon retain];
     157   
     158    [NSApp setApplicationIconImage: dockIcon];
     159    [dockIcon release];
    171160}
    172161
     
    174163{
    175164    [NSApp setApplicationIconImage: fDockIcon];
    176     fNonDefault = NO;
    177165}
    178166
Note: See TracChangeset for help on using the changeset viewer.