mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 22:23:52 +00:00
Improve selection visibility on tvOS
This commit is contained in:
@@ -19,8 +19,10 @@
|
|||||||
static const float REFRESH_CYCLE = 2.0f;
|
static const float REFRESH_CYCLE = 2.0f;
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
|
static const int ITEM_PADDING = 50;
|
||||||
static const int LABEL_DY = 40;
|
static const int LABEL_DY = 40;
|
||||||
#else
|
#else
|
||||||
|
static const int ITEM_PADDING = 0;
|
||||||
static const int LABEL_DY = 20;
|
static const int LABEL_DY = 20;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -122,8 +124,7 @@ static const int LABEL_DY = 20;
|
|||||||
_hostLabel.frame.size.height +
|
_hostLabel.frame.size.height +
|
||||||
LABEL_DY / 2;
|
LABEL_DY / 2;
|
||||||
|
|
||||||
self.bounds = CGRectMake(x, y, width, height);
|
self.bounds = CGRectMake(x - ITEM_PADDING, y - ITEM_PADDING, width + 2 * ITEM_PADDING, height + 2 * ITEM_PADDING);
|
||||||
self.frame = CGRectMake(x, y, width, height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) updateContentsForHost:(TemporaryHost*)host {
|
- (void) updateContentsForHost:(TemporaryHost*)host {
|
||||||
@@ -181,8 +182,8 @@ static const int LABEL_DY = 20;
|
|||||||
UIButton *previousButton = (UIButton *)context.previouslyFocusedItem;
|
UIButton *previousButton = (UIButton *)context.previouslyFocusedItem;
|
||||||
UIButton *nextButton = (UIButton *) context.nextFocusedItem;
|
UIButton *nextButton = (UIButton *) context.nextFocusedItem;
|
||||||
|
|
||||||
previousButton.layer.shadowColor = [[UIColor blackColor] CGColor];
|
previousButton.superview.backgroundColor = nil;
|
||||||
nextButton.layer.shadowColor = [[UIColor greenColor] CGColor];
|
nextButton.superview.backgroundColor = [UIColor darkGrayColor];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -909,10 +909,18 @@ static NSMutableSet* hostList;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (float) getCompViewX:(UIComputerView*)comp addComp:(UIComputerView*)addComp prevEdge:(float)prevEdge {
|
- (float) getCompViewX:(UIComputerView*)comp addComp:(UIComputerView*)addComp prevEdge:(float)prevEdge {
|
||||||
|
float padding;
|
||||||
|
|
||||||
|
#if TARGET_OS_TV
|
||||||
|
padding = 100;
|
||||||
|
#else
|
||||||
|
padding = addComp.frame.size.width / 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (prevEdge == -1) {
|
if (prevEdge == -1) {
|
||||||
return hostScrollView.frame.origin.x + comp.frame.size.width / 2 + addComp.frame.size.width / 2;
|
return hostScrollView.frame.origin.x + comp.frame.size.width / 2 + padding;
|
||||||
} else {
|
} else {
|
||||||
return prevEdge + addComp.frame.size.width / 2 + comp.frame.size.width / 2;
|
return prevEdge + comp.frame.size.width / 2 + padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user