Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
[#449] removed NSColor#hiNativeColor
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Mar 29, 2015
1 parent a35eb72 commit 8d94fb6
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 46 deletions.
2 changes: 0 additions & 2 deletions Hive/Categories/NSColor+Hive.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

+ (NSColor *)hiWindowBackgroundColor;

- (CGColorRef)hiNativeColor;

@end
10 changes: 0 additions & 10 deletions Hive/Categories/NSColor+Hive.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,4 @@ + (NSColor *)hiWindowBackgroundColor {
return [NSColor colorWithCalibratedWhite:0.94 alpha:1.0];
}

- (CGColorRef)hiNativeColor {
const NSInteger numberOfComponents = [self numberOfComponents];
CGFloat components[numberOfComponents];
CGColorSpaceRef colorSpace = [[self colorSpace] CGColorSpace];

[self getComponents:(CGFloat *)&components];

return (__bridge CGColorRef) CFBridgingRelease(CGColorCreate(colorSpace, components));
}

@end
6 changes: 3 additions & 3 deletions Hive/Controllers/HIContactTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ - (NSView *)horizontalLineAtPosition:(CGFloat)position color:(NSColor *)color {
NSRect frame = NSMakeRect(0, position, self.view.frame.size.width, 1);
NSView *line = [[NSView alloc] initWithFrame:frame];
line.wantsLayer = YES;
line.layer.backgroundColor = [color hiNativeColor];
line.layer.backgroundColor = [color CGColor];
line.autoresizingMask = NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable;
return line;
}
Expand All @@ -78,8 +78,8 @@ - (NSView *)verticalSeparatorAtPosition:(CGFloat)position color:(NSColor *)color
NSRect frame = NSMakeRect(position, 10, 1, self.view.frame.size.height - 20);
NSView *line = [[NSView alloc] initWithFrame:frame];
line.wantsLayer = YES;
line.layer.backgroundColor = [color hiNativeColor];
line.layer.shadowColor = [[NSColor whiteColor] hiNativeColor];
line.layer.backgroundColor = [color CGColor];
line.layer.shadowColor = [[NSColor whiteColor] CGColor];
line.layer.shadowOffset = NSMakeSize(1.0, 0.0);
line.layer.shadowOpacity = 1.0;
line.layer.shadowRadius = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HIContactViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (void)loadView {
[super loadView];
[_infoPanel loadView];

self.view.layer.backgroundColor = [[NSColor hiWindowBackgroundColor] hiNativeColor];
self.view.layer.backgroundColor = [[NSColor hiWindowBackgroundColor] CGColor];

[self.tabBarController selectTabAtIndex:0];
}
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HIContactsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB
- (void)awakeFromNib {
[self.foreverAloneScreen setFrame:self.view.bounds];
[self.foreverAloneScreen setHidden:YES];
[self.foreverAloneScreen.layer setBackgroundColor:[[NSColor hiWindowBackgroundColor] hiNativeColor]];
[self.foreverAloneScreen.layer setBackgroundColor:[[NSColor hiWindowBackgroundColor] CGColor]];
[self.view addSubview:self.foreverAloneScreen];

[[NSUserDefaults standardUserDefaults] registerDefaults:@{ SortByLastNamePreferencesKey: @1 }];
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HIMainWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ - (void)slideControllerIntoView:(HIViewController *)newController slideOut:(HIVi
newTitleView.alphaValue = 0.0;
[self.appStoreWindow.titleBarView addSubview:newTitleView];

newController.view.layer.shadowColor = [[NSColor blackColor] hiNativeColor];
newController.view.layer.shadowColor = [[NSColor blackColor] CGColor];
newController.view.layer.shadowOffset = CGSizeMake(50.0, 0.0);
newController.view.layer.shadowRadius = 50.0;
newController.view.layer.shadowOpacity = 0.25;
Expand Down
6 changes: 3 additions & 3 deletions Hive/Controllers/HINewContactViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ - (void)loadView {
[super loadView];

[self setUpQrCodeButton];
_avatarView.layer.backgroundColor = [[NSColor whiteColor] hiNativeColor];
_avatarView.layer.backgroundColor = [[NSColor whiteColor] CGColor];

// Hide some buttons if necessary

Expand Down Expand Up @@ -230,7 +230,7 @@ - (void)addAddressPlaceholderWithHash:(NSString *)address name:(NSString *)name
NSMakeRect(1, AddressCellHeight, self.walletsView.bounds.size.width - 2, 1)];

separator.wantsLayer = YES;
separator.layer.backgroundColor = [[NSColor colorWithCalibratedWhite:0.5 alpha:0.5] hiNativeColor];
separator.layer.backgroundColor = [[NSColor colorWithCalibratedWhite:0.5 alpha:0.5] CGColor];
separator.autoresizingMask = NSViewMinYMargin | NSViewWidthSizable;

[self.walletsView addSubview:separator];
Expand All @@ -239,7 +239,7 @@ - (void)addAddressPlaceholderWithHash:(NSString *)address name:(NSString *)name

NSView *fieldContentView = [[NSView alloc] initWithFrame:
NSMakeRect(0, 0, self.walletsView.bounds.size.width - 40, AddressCellHeight)];
fieldContentView.layer.backgroundColor = [[NSColor clearColor] hiNativeColor];
fieldContentView.layer.backgroundColor = [[NSColor clearColor] CGColor];
fieldContentView.autoresizingMask = NSViewMinYMargin | NSViewWidthSizable;
[self.walletsView addSubview:fieldContentView];
parts[ContentsView] = fieldContentView;
Expand Down
4 changes: 2 additions & 2 deletions Hive/Controllers/HIProfileViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ - (void)loadView {
[super loadView];
[_infoPanel loadView];

self.view.layer.backgroundColor = [[NSColor hiWindowBackgroundColor] hiNativeColor];
self.view.layer.backgroundColor = [[NSColor hiWindowBackgroundColor] CGColor];

self.photoView.layer.borderWidth = 1.0;
self.photoView.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.88 alpha:1.0] hiNativeColor];
self.photoView.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.88 alpha:1.0] CGColor];

[self setupBitcoinFormatLists];
[self setupCurrencyLists];
Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HIQRCodeWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void)windowDidLoad {
[super windowDidLoad];

[self.window.contentView setWantsLayer:YES];
[self.window.contentView layer].backgroundColor = [NSColor whiteColor].hiNativeColor;
[self.window.contentView layer].backgroundColor = [[NSColor whiteColor] CGColor];
}


Expand Down
10 changes: 5 additions & 5 deletions Hive/Controllers/HISendBitcoinsWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ - (void)windowDidLoad {

NSView *wrapperContents = self.wrapper.contentView;
wrapperContents.layer.borderWidth = 1.0;
wrapperContents.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.8 alpha:1.0] hiNativeColor];
wrapperContents.layer.backgroundColor = [[NSColor whiteColor] hiNativeColor];
wrapperContents.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.8 alpha:1.0] CGColor];
wrapperContents.layer.backgroundColor = [[NSColor whiteColor] CGColor];
wrapperContents.layer.cornerRadius = 5.0;

self.detailsBox.layer.borderWidth = 1.0;
self.detailsBox.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.85 alpha:1.0] hiNativeColor];
self.detailsBox.layer.borderColor = [[NSColor colorWithCalibratedWhite:0.85 alpha:1.0] CGColor];
[[self.detailsBox documentView] setTextContainerInset:NSMakeSize(1.0, 5.0)];

[self setupQRCodeButton];
Expand Down Expand Up @@ -895,8 +895,8 @@ - (void)showPaymentConfirmation:(NSDictionary *)data {
NSColor *borderColor = [NSColor colorWithCalibratedHue:95.0/360 saturation:0.5 brightness:0.8 alpha:1.0];

NSView *ackBarContents = self.ackBar.contentView;
ackBarContents.layer.backgroundColor = [fillColor hiNativeColor];
ackBarContents.layer.borderColor = [borderColor hiNativeColor];
ackBarContents.layer.backgroundColor = [fillColor CGColor];
ackBarContents.layer.borderColor = [borderColor CGColor];
ackBarContents.layer.borderWidth = 1.0;
ackBarContents.layer.cornerRadius = 5.0;

Expand Down
2 changes: 1 addition & 1 deletion Hive/Controllers/HITransactionsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ - (void)loadView {

[self.noTransactionsView setFrame:self.view.bounds];
[self.noTransactionsView setHidden:YES];
[self.noTransactionsView.layer setBackgroundColor:[[NSColor hiWindowBackgroundColor] hiNativeColor]];
[self.noTransactionsView.layer setBackgroundColor:[[NSColor hiWindowBackgroundColor] CGColor]];
[self.view addSubview:self.noTransactionsView];

[self.arrayController addObserver:self
Expand Down
2 changes: 1 addition & 1 deletion Hive/Views/HIAddressesBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (NSView *)addressSeparatorViewAtIndex:(NSInteger)index {
NSView *separator = [[NSView alloc] initWithFrame:frame];

separator.wantsLayer = YES;
separator.layer.backgroundColor = [[NSColor colorWithCalibratedWhite:0.5 alpha:0.3] hiNativeColor];
separator.layer.backgroundColor = [[NSColor colorWithCalibratedWhite:0.5 alpha:0.3] CGColor];
separator.autoresizingMask = NSViewMaxYMargin | NSViewWidthSizable;

return separator;
Expand Down
4 changes: 2 additions & 2 deletions Hive/Views/HIBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ - (void)setUpBox {

self.layer.borderWidth = 1.0;
self.layer.cornerRadius = 5.0;
self.layer.borderColor = RGB(195,195,195).hiNativeColor;
self.layer.backgroundColor = [NSColor whiteColor].hiNativeColor;
self.layer.borderColor = [RGB(195,195,195) CGColor];
self.layer.backgroundColor = [[NSColor whiteColor] CGColor];
}

@end
4 changes: 2 additions & 2 deletions Hive/Views/HIButtonCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView {
[p fill];
[sP stroke];

controlView.layer.shadowColor = [[NSColor whiteColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor whiteColor] CGColor];
} else {
NSGradient *g = [[NSGradient alloc] initWithColors:@[RGB(250,250,250), RGB(237, 237, 237)]];
[g drawInBezierPath:p angle:90];
controlView.layer.shadowColor = [[NSColor blackColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor blackColor] CGColor];

if (!self.isEnabled) {
strokeColor = RGB(184, 203, 230);
Expand Down
2 changes: 1 addition & 1 deletion Hive/Views/HICopyView.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (instancetype)initWithFrame:(NSRect)frame {
_selectionView = [[NSView alloc] initWithFrame:self.bounds];
_selectionView.autoresizingMask = NSViewWidthSizable | NSViewMinYMargin;
_selectionView.wantsLayer = YES;
_selectionView.layer.backgroundColor = [RGB(42, 140, 244) hiNativeColor];
_selectionView.layer.backgroundColor = [RGB(42, 140, 244) CGColor];
_selectionView.alphaValue = 0.0;
[self addSubview:_selectionView];

Expand Down
4 changes: 2 additions & 2 deletions Hive/Views/HIDeleteButtonCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView {
[RGB(167, 31, 39) setFill];
[p fill];
[[NSColor colorWithCalibratedWhite:0 alpha:0.35] set];
controlView.layer.shadowColor = [[NSColor whiteColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor whiteColor] CGColor];
} else {
NSGradient *g = [[NSGradient alloc] initWithColors:@[RGB(248,85,94), RGB(167, 31, 39)]];
[g drawInBezierPath:p angle:90];
[RGB(255, 255, 255) set];
controlView.layer.shadowColor = [[NSColor blackColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor blackColor] CGColor];
}
[sP stroke];

Expand Down
6 changes: 3 additions & 3 deletions Hive/Views/HIGradientButtonCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView {
[RGB(35, 116, 238) setFill];
[p fill];
[[NSColor colorWithCalibratedWhite:0 alpha:0.35] set];
controlView.layer.shadowColor = [[NSColor whiteColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor whiteColor] CGColor];
} else if (self.isEnabled) {
NSGradient *g = [[NSGradient alloc] initWithColors:@[RGB(54,185,251), RGB(35, 116, 238)]];
[g drawInBezierPath:p angle:90];
[RGB(255, 255, 255) set];
controlView.layer.shadowColor = [[NSColor blackColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor blackColor] CGColor];
} else {
strokeColor = RGB(184, 203, 230);
NSGradient *g = [[NSGradient alloc] initWithColors:@[RGB(204,238,255), RGB(190, 209, 238)]];
[g drawInBezierPath:p angle:90];
[RGB(255, 255, 255) set];
controlView.layer.shadowColor = [[NSColor grayColor] hiNativeColor];
controlView.layer.shadowColor = [[NSColor grayColor] CGColor];
}
if (self.hasShadow) {
[sP stroke];
Expand Down
2 changes: 1 addition & 1 deletion Hive/Views/HIRightPointingArrowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ - (instancetype)initWithFrame:(NSRect)frame {
_strokeColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.75];
_strokeWidth = 0.5;

self.layer.shadowColor = [[NSColor whiteColor] hiNativeColor];
self.layer.shadowColor = [[NSColor whiteColor] CGColor];
self.layer.shadowOffset = NSMakeSize(1, -1);
self.layer.shadowOpacity = 1.0;
self.layer.shadowRadius = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion Hive/Views/HISeparatorView.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation HISeparatorView

- (void)awakeFromNib {
self.wantsLayer = YES;
self.layer.backgroundColor = [RGB(211,211,211) hiNativeColor];
self.layer.backgroundColor = [RGB(211,211,211) CGColor];
}


Expand Down
6 changes: 3 additions & 3 deletions Hive/Views/HITextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ - (void)awakeFromNib {
self.frame.size.width + 2,
self.frame.size.height + 2)];
_bgView.wantsLayer = YES;
_bgView.layer.backgroundColor = [[NSColor whiteColor] hiNativeColor];
_bgView.layer.backgroundColor = [[NSColor whiteColor] CGColor];
_bgView.layer.borderWidth = 1.0;
_bgView.layer.borderColor = [[NSColor blackColor] hiNativeColor];
_bgView.layer.borderColor = [[NSColor blackColor] CGColor];
_bgView.autoresizingMask = NSViewMaxYMargin | NSViewMinXMargin;
_bgView.layer.shadowColor = [[NSColor colorWithCalibratedWhite:0.3 alpha:1.0] hiNativeColor];
_bgView.layer.shadowColor = [[NSColor colorWithCalibratedWhite:0.3 alpha:1.0] CGColor];
_bgView.layer.shadowOffset = NSMakeSize(-2, -2);
_bgView.layer.shadowOpacity = 0.8;
_bgView.layer.shadowRadius = 2.0;
Expand Down

0 comments on commit 8d94fb6

Please sign in to comment.