1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 00:34:04 +00:00

in the groups menu, show the "blank group" image; resize the images in the groups menu appropriately

This commit is contained in:
Mitchell Livingston 2008-05-31 02:52:49 +00:00
parent 62f034cdbd
commit 1cb0451c05
2 changed files with 20 additions and 2 deletions

View file

@ -27,6 +27,7 @@
#import "NSBezierPathAdditions.h"
#define ICON_WIDTH 16.0
#define ICON_WIDTH_SMALL 12.0
@interface GroupsController (Private)
@ -251,6 +252,16 @@ GroupsController * fGroupsInstance = nil;
keyEquivalent: @""];
[item setTarget: target];
[item setTag: -1];
NSImage * icon = [[NSImage imageNamed: @"GroupsNoneTemplate.png"] copy];
if (small)
{
[icon setScalesWhenResized: YES];
[icon setSize: NSMakeSize(ICON_WIDTH_SMALL, ICON_WIDTH_SMALL)];
}
[item setImage: icon];
[icon release];
[menu addItem: item];
[item release];
@ -261,10 +272,17 @@ GroupsController * fGroupsInstance = nil;
item = [[NSMenuItem alloc] initWithTitle: [dict objectForKey: @"Name"] action: action keyEquivalent: @""];
[item setTarget: target];
#warning factor in size
[item setImage: [self imageForGroup: dict]];
[item setTag: [[dict objectForKey: @"Index"] intValue]];
NSImage * icon = [[self imageForGroup: dict] copy];
if (small)
{
[icon setScalesWhenResized: YES];
[icon setSize: NSMakeSize(ICON_WIDTH_SMALL, ICON_WIDTH_SMALL)];
}
[item setImage: icon];
[icon release];
[menu addItem: item];
[item release];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 326 B