mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing gradients to be at the correct height and position.
This commit is contained in:
parent
d8a847f6f4
commit
98e256243d
4 changed files with 16 additions and 11 deletions
|
@ -57,8 +57,12 @@
|
|||
|
||||
UILabel *titleLabel = [[[UILabel alloc] init] autorelease];
|
||||
if (appDelegate.isRiverView) {
|
||||
self.storyTitlesTable.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.storyTitlesTable.separatorColor = [UIColor clearColor];
|
||||
titleLabel.text = [NSString stringWithFormat:@" %@", appDelegate.activeFolder];
|
||||
} else {
|
||||
self.storyTitlesTable.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
|
||||
self.storyTitlesTable.separatorColor = [UIColor colorWithRed:.9 green:.9 blue:.9 alpha:1.0];
|
||||
titleLabel.text = [NSString stringWithFormat:@" %@", [appDelegate.activeFeed objectForKey:@"feed_title"]];
|
||||
}
|
||||
titleLabel.backgroundColor = [UIColor clearColor];
|
||||
|
@ -115,6 +119,7 @@
|
|||
action:@selector(selectIntelligence)
|
||||
forControlEvents:UIControlEventValueChanged];
|
||||
[self.intelligenceControl setSelectedSegmentIndex:[appDelegate selectedIntelligence]+1];
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
}
|
||||
|
||||
|
@ -448,7 +453,7 @@
|
|||
// River view
|
||||
if (appDelegate.isRiverView && cell) {
|
||||
UIView *gradientView = [appDelegate makeFeedTitleGradient:feed
|
||||
withRect:CGRectMake(0, 0, cell.frame.size.width, 20)];
|
||||
withRect:CGRectMake(0, 0, cell.frame.size.width, 21)];
|
||||
[cell.feedGradient addSubview:gradientView];
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@
|
|||
UIView *gradientView = [[[UIView alloc] initWithFrame:rect] autorelease];
|
||||
|
||||
CAGradientLayer *gradient = [CAGradientLayer layer];
|
||||
gradient.frame = CGRectMake(0, 0, rect.size.width, rect.size.height);
|
||||
gradient.frame = CGRectMake(0, 1, rect.size.width, rect.size.height-1);
|
||||
gradient.opacity = 1;
|
||||
unsigned int color = 0;
|
||||
unsigned int colorFade = 0;
|
||||
|
@ -415,14 +415,14 @@
|
|||
gradient.colors = [NSArray arrayWithObjects:(id)[UIColorFromRGB(color) CGColor], (id)[UIColorFromRGB(colorFade) CGColor], nil];
|
||||
|
||||
CALayer *whiteBackground = [CALayer layer];
|
||||
whiteBackground.frame = CGRectMake(0, 0, rect.size.width, rect.size.height);
|
||||
whiteBackground.frame = CGRectMake(0, 1, rect.size.width, rect.size.height-1);
|
||||
whiteBackground.backgroundColor = [UIColor whiteColor].CGColor;
|
||||
[gradientView.layer addSublayer:whiteBackground];
|
||||
|
||||
[gradientView.layer addSublayer:gradient];
|
||||
|
||||
CALayer *topBorder = [CALayer layer];
|
||||
topBorder.frame = CGRectMake(0, 0, rect.size.width, 1);
|
||||
topBorder.frame = CGRectMake(0, 1, rect.size.width, 1);
|
||||
topBorder.backgroundColor = UIColorFromRGB(colorFade).CGColor;
|
||||
topBorder.opacity = 1;
|
||||
[gradientView.layer addSublayer:topBorder];
|
||||
|
@ -462,12 +462,12 @@
|
|||
titleLabel.textColor = [UIColor whiteColor];
|
||||
titleLabel.shadowColor = [UIColor blackColor];
|
||||
}
|
||||
titleLabel.frame = CGRectMake(32, 0, window.frame.size.width-20, 20);
|
||||
titleLabel.frame = CGRectMake(32, 1, window.frame.size.width-20, 20);
|
||||
|
||||
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [feed objectForKey:@"id"]];
|
||||
UIImage *titleImage = [Utilities getImage:feedIdStr];
|
||||
UIImageView *titleImageView = [[UIImageView alloc] initWithImage:titleImage];
|
||||
titleImageView.frame = CGRectMake(8, 2, 16.0, 16.0);
|
||||
titleImageView.frame = CGRectMake(8, 3, 16.0, 16.0);
|
||||
[titleLabel addSubview:titleImageView];
|
||||
[titleImageView release];
|
||||
|
||||
|
|
|
@ -284,15 +284,15 @@
|
|||
[appDelegate.activeStory
|
||||
objectForKey:@"story_feed_id"]]];
|
||||
UIView *feedTitleGradient = [appDelegate makeFeedTitleGradient:feed
|
||||
withRect:CGRectMake(0, -20, self.webView.frame.size.width, 20)];
|
||||
withRect:CGRectMake(-1, -20, self.webView.frame.size.width, 21)];
|
||||
|
||||
for (NSObject *aSubView in [self.webView subviews]) {
|
||||
if ([aSubView isKindOfClass:[UIScrollView class]]) {
|
||||
UIScrollView * theScrollView = (UIScrollView *)aSubView;
|
||||
if (appDelegate.isRiverView) {
|
||||
theScrollView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
|
||||
theScrollView.contentInset = UIEdgeInsetsMake(19, 0, 0, 0);
|
||||
} else {
|
||||
theScrollView.contentInset = UIEdgeInsetsMake(10, 0, 0, 0);
|
||||
theScrollView.contentInset = UIEdgeInsetsMake(9, 0, -9, 0);
|
||||
}
|
||||
feedTitleGradient.tag = 12; // Not attached yet. Remove old gradients, first.
|
||||
for (UIView *subview in theScrollView.subviews) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// #define BACKGROUND_REFRESH_SECONDS -5
|
||||
#define BACKGROUND_REFRESH_SECONDS -10*60
|
||||
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.host:8000"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.host:8000"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue