Changeset 12473


Ignore:
Timestamp:
May 30, 2011, 12:09:22 AM (10 years ago)
Author:
livings124
Message:

instead of displaying a star for multiple priorities, display all relevant icons

Location:
trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r12461 r12473  
    11=== Transmission 2.32 (2011/xx/yy) ===
    22[http://trac.transmissionbt.com/query?milestone=2.32&group=component&order=severity All tickets closed by this release]
     3==== Mac ====
     4  * Lion stability fixes
    35==== GTK+ ====
    46  * Remove GNOME desktop proxy support
  • trunk/Transmission.xcodeproj/project.pbxproj

    r12457 r12473  
    105105                A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */; };
    106106                A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F820C4D8A610034AB1D /* PriorityHigh.png */; };
    107                 A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */; };
    108107                A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FA40C4D97840034AB1D /* PriorityNone.png */; };
    109108                A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */; };
     
    569568                A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityLow.png; path = macosx/Images/PriorityLow.png; sourceTree = "<group>"; };
    570569                A20B6F820C4D8A610034AB1D /* PriorityHigh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityHigh.png; path = macosx/Images/PriorityHigh.png; sourceTree = "<group>"; };
    571                 A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityMixed.png; path = macosx/Images/PriorityMixed.png; sourceTree = "<group>"; };
    572570                A20B6FA40C4D97840034AB1D /* PriorityNone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNone.png; path = macosx/Images/PriorityNone.png; sourceTree = "<group>"; };
    573571                A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNormal.png; path = macosx/Images/PriorityNormal.png; sourceTree = "<group>"; };
     
    12211219                                A209EC11114301C6002B02D1 /* InfoOptionsView.xib */,
    12221220                                A20B6FA40C4D97840034AB1D /* PriorityNone.png */,
    1223                                 A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */,
    12241221                                A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */,
    12251222                                A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */,
     
    20462043                                A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */,
    20472044                                A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */,
    2048                                 A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */,
    20492045                                A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */,
    20502046                                A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */,
  • trunk/macosx/FilePriorityCell.m

    r12445 r12473  
    2828#import "NSApplicationAdditions.h"
    2929#import "Torrent.h"
     30
     31#define IMAGE_OVERLAP 3.0
    3032
    3133@implementation FilePriorityCell
     
    124126    else
    125127    {
    126         NSImage * image;
     128        NSMutableArray * images = [NSMutableArray arrayWithCapacity: MAX(count, 1)];
     129        CGFloat totalWidth;
     130       
    127131        if (count == 0)
    128             image = [NSImage imageNamed: @"PriorityNone.png"];
    129         else if (count > 1)
    130             image = [NSImage imageNamed: @"PriorityMixed.png"];
     132        {
     133            NSImage * image = [NSImage imageNamed: @"PriorityNone.png"];
     134            [images addObject: image];
     135            totalWidth = [image size].width;
     136        }
    131137        else
    132138        {
    133             switch ([[priorities anyObject] integerValue])
     139            totalWidth = 0.0;
     140            if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_LOW]])
    134141            {
    135                 case TR_PRI_NORMAL:
    136                     image = [NSImage imageNamed: @"PriorityNormal.png"];
    137                     break;
    138                 case TR_PRI_LOW:
    139                     image = [NSImage imageNamed: @"PriorityLow.png"];
    140                     break;
    141                 case TR_PRI_HIGH:
    142                     image = [NSImage imageNamed: @"PriorityHigh.png"];
    143                     break;
     142                NSImage * image = [NSImage imageNamed: @"PriorityLow.png"];
     143                [images addObject: image];
     144                totalWidth += [image size].width;
     145            }
     146            if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_NORMAL]])
     147            {
     148                NSImage * image = [NSImage imageNamed: @"PriorityNormal.png"];
     149                [images addObject: image];
     150                totalWidth += [image size].width;
     151            }
     152            if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_HIGH]])
     153            {
     154                NSImage * image = [NSImage imageNamed: @"PriorityHigh.png"];
     155                [images addObject: image];
     156                totalWidth += [image size].width;
    144157            }
    145158        }
    146159       
    147         NSSize imageSize = [image size];
    148         NSRect imageRect = NSMakeRect(NSMidX(cellFrame) - imageSize.width * 0.5, NSMidY(cellFrame) - imageSize.height * 0.5,
    149                                         imageSize.width, imageSize.height);
     160        if (count > 1)
     161            totalWidth -= IMAGE_OVERLAP * (count-1);
    150162       
    151         if ([NSApp isOnSnowLeopardOrBetter])
    152             [image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0
    153                 respectFlipped: YES hints: nil];
    154         else
     163        CGFloat currentWidth = floor(NSMidX(cellFrame) - totalWidth * 0.5);
     164       
     165        for (NSImage * image in images)
    155166        {
    156             image = [image copy];
    157             [image setFlipped: YES];
    158             [image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
    159             [image release];
     167            const NSSize imageSize = [image size];
     168            NSRect imageRect = NSMakeRect(currentWidth, floor(NSMidY(cellFrame) - imageSize.height * 0.5), imageSize.width, imageSize.height);
     169           
     170            if ([NSApp isOnSnowLeopardOrBetter])
     171                [image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil];
     172            else
     173            {
     174                image = [image copy];
     175                [image setFlipped: YES];
     176                [image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
     177                [image release];
     178            }
     179           
     180            currentWidth += imageSize.width - IMAGE_OVERLAP;
    160181        }
    161182    }
Note: See TracChangeset for help on using the changeset viewer.