Permalink
Browse files

more sane drawing for bar button items

  • Loading branch information...
Todd Ditchendorf
Todd Ditchendorf committed Apr 18, 2010
1 parent 457de12 commit b367599db920224bdb94df17acea8febba75d64e
Showing with 3 additions and 87 deletions.
  1. +0 −56 UMEKit.xcodeproj/project.pbxproj
  2. BIN res/img/barbutton_system_item_action.png
  3. BIN res/img/barbutton_system_item_action_hi.png
  4. BIN res/img/barbutton_system_item_add.png
  5. BIN res/img/barbutton_system_item_bookmarks.png
  6. BIN res/img/barbutton_system_item_bookmarks_hi.png
  7. BIN res/img/barbutton_system_item_camera.png
  8. BIN res/img/barbutton_system_item_camera_hi.png
  9. BIN res/img/barbutton_system_item_compose.png
  10. BIN res/img/barbutton_system_item_compose_hi.png
  11. BIN res/img/barbutton_system_item_fastforward.png
  12. BIN res/img/barbutton_system_item_fastforward_hi.png
  13. BIN res/img/barbutton_system_item_organize_hi.png
  14. BIN res/img/barbutton_system_item_pause.png
  15. BIN res/img/barbutton_system_item_pause_hi.png
  16. BIN res/img/barbutton_system_item_play.png
  17. BIN res/img/barbutton_system_item_play_hi.png
  18. BIN res/img/barbutton_system_item_refresh.png
  19. BIN res/img/barbutton_system_item_refresh_hi.png
  20. BIN res/img/barbutton_system_item_reply.png
  21. BIN res/img/barbutton_system_item_reply_hi.png
  22. BIN res/img/barbutton_system_item_rewind.png
  23. BIN res/img/barbutton_system_item_rewind_hi.png
  24. BIN res/img/barbutton_system_item_search.png
  25. BIN res/img/barbutton_system_item_search_hi.png
  26. BIN res/img/barbutton_system_item_stop.png
  27. BIN res/img/barbutton_system_item_stop_hi.png
  28. BIN res/img/barbutton_system_item_trash.png
  29. BIN res/img/barbutton_system_item_trash_hi.png
  30. +0 −22 src/UMEBarButtonItem.m
  31. +1 −7 src/UMEBarButtonItemButtonCell.m
  32. +2 −2 src/UMEToolbar.m

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
View
@@ -31,7 +31,6 @@ @implementation UMEBarButtonItem
- (id)initWithBarButtonSystemItem:(UMEBarButtonSystemItem)systemItem target:(id)t action:(SEL)sel {
NSString *aTitle = nil;
NSString *imgPath = nil;
- NSString *imgHiPath = nil;
NSBundle *b = [NSBundle bundleForClass:[UMEBarButtonItem class]];
UMEBarButtonItemStyle aStyle = UMEBarButtonItemStylePlain;
NSCellImagePosition imgPos = NSNoImage;
@@ -56,80 +55,64 @@ - (id)initWithBarButtonSystemItem:(UMEBarButtonSystemItem)systemItem target:(id)
break;
case UMEBarButtonSystemItemFlexibleSpace:
imgPath = [b pathForImageResource:@""];
- imgHiPath = [b pathForImageResource:@""];
break;
case UMEBarButtonSystemItemFixedSpace:
imgPath = [b pathForImageResource:@""];
- imgHiPath = [b pathForImageResource:@""];
break;
case UMEBarButtonSystemItemCompose:
imgPath = [b pathForImageResource:@"barbutton_system_item_compose"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_compose_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemReply:
imgPath = [b pathForImageResource:@"barbutton_system_item_reply"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_reply_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemAction:
imgPath = [b pathForImageResource:@"barbutton_system_item_action"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_action_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemOrganize:
imgPath = [b pathForImageResource:@"barbutton_system_item_organize"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_organize_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemBookmarks:
imgPath = [b pathForImageResource:@"barbutton_system_item_bookmarks"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_bookmarks_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemSearch:
imgPath = [b pathForImageResource:@"barbutton_system_item_search"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_search_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemRefresh:
imgPath = [b pathForImageResource:@"barbutton_system_item_refresh"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_refresh_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemStop:
imgPath = [b pathForImageResource:@"barbutton_system_item_stop"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_stop_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemCamera:
imgPath = [b pathForImageResource:@"barbutton_system_item_camera"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_camera_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemTrash:
imgPath = [b pathForImageResource:@"barbutton_system_item_trash"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_trash_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemPlay:
imgPath = [b pathForImageResource:@"barbutton_system_item_play"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_play_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemPause:
imgPath = [b pathForImageResource:@"barbutton_system_item_pause"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_pause_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemRewind:
imgPath = [b pathForImageResource:@"barbutton_system_item_rewind"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_rewind_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemFastForward:
imgPath = [b pathForImageResource:@"barbutton_system_item_fastforward"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_fastforward_hi"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemUndo:
@@ -139,12 +122,10 @@ - (id)initWithBarButtonSystemItem:(UMEBarButtonSystemItem)systemItem target:(id)
aTitle = NSLocalizedString(@"Redo", @"");
case UMEBarButtonSystemItemUser:
imgPath = [b pathForImageResource:@"barbutton_system_item_user"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_user"];
imgPos = NSImageOnly;
break;
case UMEBarButtonSystemItemEveryone:
imgPath = [b pathForImageResource:@"barbutton_system_item_everyone"];
- imgHiPath = [b pathForImageResource:@"barbutton_system_item_everyone"];
imgPos = NSImageOnly;
break;
default:
@@ -157,9 +138,6 @@ - (id)initWithBarButtonSystemItem:(UMEBarButtonSystemItem)systemItem target:(id)
self.image = [[[NSImage alloc] initWithContentsOfFile:imgPath] autorelease];
}
[button setImagePosition:imgPos];
- if ([imgHiPath length]) {
- [button setAlternateImage:[[[NSImage alloc] initWithContentsOfFile:imgHiPath] autorelease]];
- }
return self;
}
@@ -210,13 +210,7 @@ - (void)drawInteriorWithFrame:(NSRect)r inView:(NSView *)cv {
// draw image
if (NSImageOnly == [self imagePosition]) {
- NSImage *img = nil;
- if ([self isHighlighted]) {
- img = [self alternateImage];
- } else {
- img = [self image];
- }
-
+ NSImage *img = [self image];
[img setFlipped:[cv isFlipped]];
NSSize size = [img size];
View
@@ -25,7 +25,7 @@ @implementation UMEToolbar
+ (void)initialize {
if ([UMEToolbar class] == self) {
- NSBundle *b = [NSBundle bundleForClass:self];
+ NSBundle *b = [NSBundle bundleForClass:[UMEToolbar class]];
sDefaultBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_default"]];
sBlackBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_black"]];
@@ -36,7 +36,7 @@ + (void)initialize {
- (id)initWithFrame:(NSRect)frame {
if (self = [super initWithFrame:frame]) {
- self.barStyle = UMEBarStyleBlack;
+ self.barStyle = UMEBarStyleDefault;
}
return self;
}

0 comments on commit b367599

Please sign in to comment.