Skip to content

Commit 5ebb9fe

Browse files
committed
Improved layout, added tint for buttons
1 parent 0a79cd5 commit 5ebb9fe

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

BitStoreToday/TodayViewController.m

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,45 @@ @implementation TodayViewController {
2121

2222
- (void)viewDidLoad {
2323
[super viewDidLoad];
24-
self.preferredContentSize = CGSizeMake(200, 65);
24+
self.preferredContentSize = CGSizeMake(200, 64);
2525
}
2626

2727
- (void)viewWillAppear:(BOOL)animated {
2828
[super viewWillAppear:animated];
2929

30-
UILabel* description = [[UILabel alloc] initWithFrame:CGRectMake(0, 18, 200, 30)];
30+
UILabel* description = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
3131
description.text = @"Current price:";
3232
description.font = [UIFont systemFontOfSize:13];
3333
description.textColor = [UIColor colorWithWhite:0.5 alpha:1.0];
3434
[self.view addSubview:description];
3535

36-
_priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 45, 200, 30)];
36+
_priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 27, 200, 30)];
3737
_priceLabel.textColor = [UIColor whiteColor];
3838
_priceLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:24];
3939
[self updatePriceLabel];
4040
[self.view addSubview:_priceLabel];
4141

4242

43+
UIColor* buttonTintColor = [UIColor whiteColor];
44+
UIColor* buttonSelectedColor = [UIColor colorWithWhite:0.8 alpha:1.0];
45+
4346
NSString* sendTitle = NSLocalizedString(@"send", nil);
4447
AccountActionButton* sendButton = [[AccountActionButton alloc] initWithTitle:sendTitle image:[UIImage imageNamed:@"send"] selectedImage:[UIImage imageNamed:@"send_selected"]];
4548
sendButton.padding = 5;
49+
[sendButton setTintColor:buttonTintColor];
50+
[sendButton setSelectedTintColor:buttonSelectedColor];
4651
CGSize sendSize = [sendTitle sizeWithAttributes:@{NSFontAttributeName:sendButton.titleLabel.font}];
47-
sendButton.frame = CGRectMake(self.view.bounds.size.width - sendSize.width - 30, 25, sendSize.width, 50);
52+
sendButton.frame = CGRectMake(self.view.bounds.size.width - sendSize.width - 30, 7, sendSize.width, 50);
4853
[self.view addSubview:sendButton];
4954

5055

5156
NSString* receiveTitle = NSLocalizedString(@"receive", nil);
5257
AccountActionButton* receiveButton = [[AccountActionButton alloc] initWithTitle:receiveTitle image:[UIImage imageNamed:@"receive"] selectedImage:[UIImage imageNamed:@"receive_selected"]];
53-
receiveButton.padding = 5;
58+
receiveButton.padding = 10;
59+
[receiveButton setTintColor:buttonTintColor];
60+
[receiveButton setSelectedTintColor:buttonSelectedColor];
5461
CGSize receiveSize = [receiveTitle sizeWithAttributes:@{NSFontAttributeName:receiveButton.titleLabel.font}];
55-
receiveButton.frame = CGRectMake(self.view.bounds.size.width - receiveSize.width - sendSize.width - 60, 34, receiveSize.width, 50);
62+
receiveButton.frame = CGRectMake(self.view.bounds.size.width - receiveSize.width - sendSize.width - 60, 12, receiveSize.width, 50);
5663
[self.view addSubview:receiveButton];
5764
}
5865

@@ -90,6 +97,11 @@ - (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))compl
9097
}];
9198
}
9299

100+
- (UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets)defaultMarginInsets {
101+
UIEdgeInsets newInsets = UIEdgeInsetsMake(18, defaultMarginInsets.left - 0, 18, defaultMarginInsets.right);
102+
return newInsets;
103+
}
104+
93105
- (NSUserDefaults *)userDefaults {
94106
return [[NSUserDefaults alloc]initWithSuiteName:@"com.dylanmarriott.BitStore"];
95107
}

0 commit comments

Comments
 (0)