Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

navy toolbar style

  • Loading branch information...
commit ddcb16f334a5224b1d72d1f81a7291469b60e572 1 parent 0182ffc
Todd Ditchendorf authored
View
752 UMEKit.xcodeproj/project.pbxproj
390 additions, 362 deletions not shown
View
2  demoapp/MyRootViewController.m
@@ -106,7 +106,7 @@ - (void)viewDidLoad {
item = [[[UMEBarButtonItem alloc] initWithBarButtonSystemItem:UMEBarButtonSystemItemDone target:nil action:nil] autorelease];
[items addObject:item];
- toolbar.barStyle = UMEBarStyleBlack;
+ toolbar.barStyle = UMEBarStyleNavy;
toolbar.items = items;
}
View
1  include/UMEKit/UMEInterface.h
@@ -16,5 +16,6 @@ typedef enum {
UMEBarStyleDefault = 0,
UMEBarStyleBlack = 1,
UMEBarStyleGray = 2,
+ UMEBarStyleNavy = 3,
} UMEBarStyle;
View
BIN  res/img/barbuttonitem_navy_plain_bg_01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/barbuttonitem_navy_plain_bg_02.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/barbuttonitem_navy_plain_bg_03.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/barbuttonitem_navy_plain_bg_hi_01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/barbuttonitem_navy_plain_bg_hi_02.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/barbuttonitem_navy_plain_bg_hi_03.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/img/toolbar_bg_navy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/psd/barbuttonitem_plain_bg.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/psd/popovers.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/psd/toolbar_bg.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
77 src/UMEBarButtonItemButtonCell.m
@@ -95,6 +95,28 @@
static NSImage *sGrayRightImageDoneHi = nil;
static NSImage *sGrayRightImageBackHi = nil;
+// barStyle navy
+static NSImage *sNavyLeftImagePlain = nil;
+static NSImage *sNavyLeftImageDone = nil;
+static NSImage *sNavyLeftImageBack = nil;
+static NSImage *sNavyCenterImagePlain = nil;
+static NSImage *sNavyCenterImageDone = nil;
+static NSImage *sNavyCenterImageBack = nil;
+static NSImage *sNavyRightImagePlain = nil;
+static NSImage *sNavyRightImageDone = nil;
+static NSImage *sNavyRightImageBack = nil;
+
+// barStyle navy hi
+static NSImage *sNavyLeftImagePlainHi = nil;
+static NSImage *sNavyLeftImageDoneHi = nil;
+static NSImage *sNavyLeftImageBackHi = nil;
+static NSImage *sNavyCenterImagePlainHi = nil;
+static NSImage *sNavyCenterImageDoneHi = nil;
+static NSImage *sNavyCenterImageBackHi = nil;
+static NSImage *sNavyRightImagePlainHi = nil;
+static NSImage *sNavyRightImageDoneHi = nil;
+static NSImage *sNavyRightImageBackHi = nil;
+
@interface UMEBarButtonItem ()
@property (nonatomic) UMEBarStyle barStyle; // default is UMEBarStyleDefault
@end
@@ -182,6 +204,28 @@ + (void)initialize {
sGrayRightImageDoneHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_gray_done_bg_hi_03"]];
sGrayRightImageBackHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_gray_back_bg_hi_03"]];
+ // barStyle navy
+ sNavyLeftImagePlain = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_01"]];
+ sNavyLeftImageDone = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_01"]];
+ sNavyLeftImageBack = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_01"]];
+ sNavyCenterImagePlain = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_02"]];
+ sNavyCenterImageDone = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_02"]];
+ sNavyCenterImageBack = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_02"]];
+ sNavyRightImagePlain = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_03"]];
+ sNavyRightImageDone = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_03"]];
+ sNavyRightImageBack = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_03"]];
+
+ // barStyle navy hi
+ sNavyLeftImagePlainHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_hi_01"]];
+ sNavyLeftImageDoneHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_hi_01"]];
+ sNavyLeftImageBackHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_hi_01"]];
+ sNavyCenterImagePlainHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_hi_02"]];
+ sNavyCenterImageDoneHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_hi_02"]];
+ sNavyCenterImageBackHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_hi_02"]];
+ sNavyRightImagePlainHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_plain_bg_hi_03"]];
+ sNavyRightImageDoneHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_done_bg_hi_03"]];
+ sNavyRightImageBackHi = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"barbuttonitem_navy_back_bg_hi_03"]];
+
[pool release];
}
}
@@ -270,6 +314,17 @@ - (void)drawBackgroundWithFrame:(NSRect)r inView:(NSView *)cv {
rightImage = sGrayRightImagePlain;
}
break;
+ case UMEBarStyleNavy:
+ if ([self isHighlighted]) {
+ leftImage = sNavyLeftImagePlainHi;
+ centerImage = sNavyCenterImagePlainHi;
+ rightImage = sNavyRightImagePlainHi;
+ } else {
+ leftImage = sNavyLeftImagePlain;
+ centerImage = sNavyCenterImagePlain;
+ rightImage = sNavyRightImagePlain;
+ }
+ break;
default:
break;
}
@@ -309,6 +364,17 @@ - (void)drawBackgroundWithFrame:(NSRect)r inView:(NSView *)cv {
rightImage = sGrayRightImageDone;
}
break;
+ case UMEBarStyleNavy:
+ if ([self isHighlighted]) {
+ leftImage = sNavyLeftImageDoneHi;
+ centerImage = sNavyCenterImageDoneHi;
+ rightImage = sNavyRightImageDoneHi;
+ } else {
+ leftImage = sNavyLeftImageDone;
+ centerImage = sNavyCenterImageDone;
+ rightImage = sNavyRightImageDone;
+ }
+ break;
default:
break;
}
@@ -348,6 +414,17 @@ - (void)drawBackgroundWithFrame:(NSRect)r inView:(NSView *)cv {
rightImage = sGrayRightImageBack;
}
break;
+ case UMEBarStyleNavy:
+ if ([self isHighlighted]) {
+ leftImage = sNavyLeftImageBackHi;
+ centerImage = sNavyCenterImageBackHi;
+ rightImage = sNavyRightImageBackHi;
+ } else {
+ leftImage = sNavyLeftImageBack;
+ centerImage = sNavyCenterImageBack;
+ rightImage = sNavyRightImageBack;
+ }
+ break;
default:
break;
}
View
5 src/UMEToolbar.m
@@ -14,6 +14,7 @@
static NSImage *sDefaultBackgroundImage = nil;
static NSImage *sBlackBackgroundImage = nil;
static NSImage *sGrayBackgroundImage = nil;
+static NSImage *sNavyBackgroundImage = nil;
@interface UMEBarButtonItem ()
- (void)sizeToFit;
@@ -34,6 +35,7 @@ + (void)initialize {
sDefaultBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_default"]];
sBlackBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_black"]];
sGrayBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_gray"]];
+ sNavyBackgroundImage = [[NSImage alloc] initWithContentsOfFile:[b pathForImageResource:@"toolbar_bg_navy"]];
}
}
@@ -89,6 +91,9 @@ - (void)drawRect:(NSRect)dirtyRect {
case UMEBarStyleGray:
bgImg = sGrayBackgroundImage;
break;
+ case UMEBarStyleNavy:
+ bgImg = sNavyBackgroundImage;
+ break;
default:
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.