Changeset 3440


Ignore:
Timestamp:
Oct 17, 2007, 4:04:51 PM (14 years ago)
Author:
livings124
Message:

changing some constants into #define

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.m

    r3386 r3440  
    2626#import "NSStringAdditions.h"
    2727
     28#define COMPLETED_BOTTOM_PADDING 5.0
     29#define SPEED_BOTTOM_PADDING 2.0
     30#define SPEED_BETWEEN_PADDING 2.0
     31
    2832@interface Badger (Private)
    2933
     
    5963{
    6064    //set completed badge to top right
    61     BOOL baseChange = fCompleted != fCompletedBadged;
    62     if (baseChange)
     65    BOOL completedChange = fCompleted != fCompletedBadged;
     66    if (completedChange)
    6367    {
    6468        fCompletedBadged = fCompleted;
     
    8993           
    9094            //ignore shadow of badge when placing string
    91             float badgeBottomExtra = 5.0;
    92             badgeRect.size.height -= badgeBottomExtra;
    93             badgeRect.origin.y += badgeBottomExtra;
     95            badgeRect.size.height -= COMPLETED_BOTTOM_PADDING;
     96            badgeRect.origin.y += COMPLETED_BOTTOM_PADDING;
    9497           
    9598            //place badge text
     
    136139            //ignore shadow of badge when placing string
    137140            NSRect stringRect = badgeRect;
    138             float badgeBottomExtra = 2.0;
    139             stringRect.size.height -= badgeBottomExtra;
    140             stringRect.origin.y += badgeBottomExtra;
     141            stringRect.size.height -= SPEED_BOTTOM_PADDING;
     142            stringRect.origin.y += SPEED_BOTTOM_PADDING;
    141143           
    142144            [dockIcon lockFocus];
     
    154156                if (uploadRateString)
    155157                {
    156                     float spaceBetween = badgeRect.size.height + 2.0;
     158                    float spaceBetween = badgeRect.size.height + SPEED_BETWEEN_PADDING;
    157159                    badgeRect.origin.y += spaceBetween;
    158160                    stringRect.origin.y += spaceBetween;
     
    169171   
    170172    //update dock badge
    171     if (baseChange || fSpeedBadge || speedBadge)
     173    if (completedChange || fSpeedBadge || speedBadge)
    172174    {
    173175        [NSApp setApplicationIconImage: dockIcon ? dockIcon : fDockIcon];
Note: See TracChangeset for help on using the changeset viewer.