Ignore:
Timestamp:
Jan 19, 2009, 10:16:19 PM (12 years ago)
Author:
livings124
Message:

(1.5x) streamline the filter button resize code a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/macosx/Controller.m

    r7754 r7756  
    40584058   
    40594059    NSRect allRect = [fNoFilterButton frame];
    4060    
    40614060    NSRect activeRect = [fActiveFilterButton frame];
    4062     activeRect.origin.x = NSMaxX(allRect) + 1.0;
    4063    
    40644061    NSRect downloadRect = [fDownloadFilterButton frame];
    4065     downloadRect.origin.x = NSMaxX(activeRect) + 1.0;
    4066    
    40674062    NSRect seedRect = [fSeedFilterButton frame];
    4068     seedRect.origin.x = NSMaxX(downloadRect) + 1.0;
    4069    
    40704063    NSRect pauseRect = [fPauseFilterButton frame];
    4071     pauseRect.origin.x = NSMaxX(seedRect) + 1.0;
    40724064   
    40734065    //size search filter to not overlap buttons
     
    40944086       
    40954087        //decrease button widths proportionally
    4096         const NSInteger all = NSWidth(allRect) * (allowedWidth / currentTotal);
    4097         const NSInteger active = NSWidth(activeRect) * (allowedWidth / currentTotal);
    4098         const NSInteger download = NSWidth(downloadRect) * (allowedWidth / currentTotal);
    4099         const NSInteger seed = NSWidth(seedRect) * (allowedWidth / currentTotal);
    4100         const NSInteger paused = NSWidth(pauseRect) * (allowedWidth / currentTotal);
    4101        
    4102         allRect.size.width = all;
    4103        
    4104         activeRect.size.width = active;
    4105         activeRect.origin.x = NSMaxX(allRect) + 1.0;
    4106        
    4107         downloadRect.size.width = download;
    4108         downloadRect.origin.x = NSMaxX(activeRect) + 1.0;
    4109        
    4110         seedRect.size.width = seed;
    4111         seedRect.origin.x = NSMaxX(downloadRect) + 1.0;
    4112        
    4113         pauseRect.size.width = paused;
    4114         pauseRect.origin.x = NSMaxX(seedRect) + 1.0;
     4088        allRect.size.width  = NSWidth(allRect) * (allowedWidth / currentTotal);
     4089        activeRect.size.width = NSWidth(activeRect) * (allowedWidth / currentTotal);
     4090        downloadRect.size.width = NSWidth(downloadRect) * (allowedWidth / currentTotal);
     4091        seedRect.size.width = NSWidth(seedRect) * (allowedWidth / currentTotal);
     4092        pauseRect.size.width = NSWidth(pauseRect) * (allowedWidth / currentTotal);
    41154093    }
    41164094    else;
     4095   
     4096    activeRect.origin.x = NSMaxX(allRect) + 1.0;
     4097    downloadRect.origin.x = NSMaxX(activeRect) + 1.0;
     4098    seedRect.origin.x = NSMaxX(downloadRect) + 1.0;
     4099    pauseRect.origin.x = NSMaxX(seedRect) + 1.0;
    41174100   
    41184101    [fNoFilterButton setFrame: allRect];
Note: See TracChangeset for help on using the changeset viewer.