tweak host card
This commit is contained in:
1 parent
76253a9583
commit
8c4f2e46f7
3 files changed
+10
-12
No files matched your search
@@ -40,6 +40,7 @@
|
|||||||
UIImageView* lockIconView;
|
UIImageView* lockIconView;
|
||||||
CGFloat computerIconMonitorCenterYOffset;
|
CGFloat computerIconMonitorCenterYOffset;
|
||||||
CGFloat buttonHeight;
|
CGFloat buttonHeight;
|
||||||
|
CGFloat buttonLabelFontSize;
|
||||||
CGFloat iconAndButtonSpacing;
|
CGFloat iconAndButtonSpacing;
|
||||||
UIColor *defaultBlue;
|
UIColor *defaultBlue;
|
||||||
UIColor *defaultGreen;
|
UIColor *defaultGreen;
|
||||||
@@ -53,10 +54,11 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
buttonLabelFontSize = 15*_sizeFactor;
|
||||||
longPressFired = false;
|
longPressFired = false;
|
||||||
computerIconMonitorCenterYOffset = -3.3*_sizeFactor;
|
computerIconMonitorCenterYOffset = -3.3*_sizeFactor;
|
||||||
iconAndButtonSpacing = 37*_sizeFactor;
|
iconAndButtonSpacing = 37*_sizeFactor;
|
||||||
buttonHeight = 40*_sizeFactor;
|
buttonHeight = 39*_sizeFactor;
|
||||||
defaultBlue = [ThemeManager appPrimaryColor];
|
defaultBlue = [ThemeManager appPrimaryColor];
|
||||||
defaultGreen = [UIColor colorWithRed:52.0/255.0 green:199.0/255.0 blue:89.0/255.0 alpha:1.0];
|
defaultGreen = [UIColor colorWithRed:52.0/255.0 green:199.0/255.0 blue:89.0/255.0 alpha:1.0];
|
||||||
// self.userIterfaceStyle = UIUserInterfaceStyleLight
|
// self.userIterfaceStyle = UIUserInterfaceStyleLight
|
||||||
@@ -263,7 +265,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(205, 68, 100, 24)];
|
self.statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(205, 68, 100, 24)];
|
||||||
self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
self.statusLabel.text = [LocalizationHelper localizedStringForKey:@"Online"];
|
self.statusLabel.text = [LocalizationHelper localizedStringForKey:@"Online"];
|
||||||
self.statusLabel.font = [UIFont systemFontOfSize:15*_sizeFactor weight:UIFontWeightMedium];
|
self.statusLabel.font = [UIFont systemFontOfSize:14*_sizeFactor weight:UIFontWeightMedium];
|
||||||
self.statusLabel.textColor = defaultGreen;
|
self.statusLabel.textColor = defaultGreen;
|
||||||
// self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor];
|
// self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor];
|
||||||
// 在线状态图标
|
// 在线状态图标
|
||||||
@@ -289,7 +291,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.appButton.frame = CGRectMake(20, 200, 150, buttonHeight);
|
self.appButton.frame = CGRectMake(20, 200, 150, buttonHeight);
|
||||||
[self.appButton setTitle:[LocalizationHelper localizedStringForKey:@"Applications"] forState:UIControlStateNormal];
|
[self.appButton setTitle:[LocalizationHelper localizedStringForKey:@"Applications"] forState:UIControlStateNormal];
|
||||||
[self.appButton setTitleColor:[ThemeManager textColorGray] forState:UIControlStateNormal]; //theme
|
[self.appButton setTitleColor:[ThemeManager textColorGray] forState:UIControlStateNormal]; //theme
|
||||||
self.appButton.titleLabel.font = [UIFont systemFontOfSize:16*_sizeFactor];
|
self.appButton.titleLabel.font = [UIFont systemFontOfSize:buttonLabelFontSize];
|
||||||
[self.appButton addTarget:self action:@selector(appButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[self.appButton addTarget:self action:@selector(appButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
[self addSubview:self.appButton];
|
[self addSubview:self.appButton];
|
||||||
[NSLayoutConstraint activateConstraints:@[
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
@@ -309,7 +311,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.launchButton.layer.cornerRadius = 10;
|
self.launchButton.layer.cornerRadius = 10;
|
||||||
[self.launchButton setTitle:[LocalizationHelper localizedStringForKey:@" Launch"] forState:UIControlStateNormal];
|
[self.launchButton setTitle:[LocalizationHelper localizedStringForKey:@" Launch"] forState:UIControlStateNormal];
|
||||||
[self.launchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; // theme
|
[self.launchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; // theme
|
||||||
self.launchButton.titleLabel.font = [UIFont boldSystemFontOfSize:16*_sizeFactor];
|
self.launchButton.titleLabel.font = [UIFont boldSystemFontOfSize:buttonLabelFontSize];
|
||||||
self.launchButton.tintColor = [UIColor whiteColor];
|
self.launchButton.tintColor = [UIColor whiteColor];
|
||||||
[self.launchButton addTarget:self action:@selector(launchButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[self.launchButton addTarget:self action:@selector(launchButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
[self addSubview:self.launchButton];
|
[self addSubview:self.launchButton];
|
||||||
@@ -338,7 +340,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.pairButton.layer.cornerRadius = 10;
|
self.pairButton.layer.cornerRadius = 10;
|
||||||
[self.pairButton setTitle:[LocalizationHelper localizedStringForKey:@" Pair with PIN"] forState:UIControlStateNormal];
|
[self.pairButton setTitle:[LocalizationHelper localizedStringForKey:@" Pair with PIN"] forState:UIControlStateNormal];
|
||||||
[self.pairButton setTitleColor:defaultBlue forState:UIControlStateNormal]; // theme
|
[self.pairButton setTitleColor:defaultBlue forState:UIControlStateNormal]; // theme
|
||||||
self.pairButton.titleLabel.font = [UIFont boldSystemFontOfSize:16*_sizeFactor];
|
self.pairButton.titleLabel.font = [UIFont boldSystemFontOfSize:buttonLabelFontSize];
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:self.pairButton.frame.size.height/3.5*_sizeFactor weight:UIImageSymbolWeightBold];
|
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:self.pairButton.frame.size.height/3.5*_sizeFactor weight:UIImageSymbolWeightBold];
|
||||||
UIImage *templateImage = [UIImage systemImageNamed:@"lock.open.fill" withConfiguration:config];
|
UIImage *templateImage = [UIImage systemImageNamed:@"lock.open.fill" withConfiguration:config];
|
||||||
@@ -372,7 +374,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.wakeupButton.layer.cornerRadius = 10;
|
self.wakeupButton.layer.cornerRadius = 10;
|
||||||
[self.wakeupButton setTitle:[LocalizationHelper localizedStringForKey:@" Wake-on-LAN"] forState:UIControlStateNormal];
|
[self.wakeupButton setTitle:[LocalizationHelper localizedStringForKey:@" Wake-on-LAN"] forState:UIControlStateNormal];
|
||||||
[self.wakeupButton setTitleColor:defaultBlue forState:UIControlStateNormal]; // theme
|
[self.wakeupButton setTitleColor:defaultBlue forState:UIControlStateNormal]; // theme
|
||||||
self.wakeupButton.titleLabel.font = [UIFont boldSystemFontOfSize:16*_sizeFactor];
|
self.wakeupButton.titleLabel.font = [UIFont boldSystemFontOfSize:buttonLabelFontSize];
|
||||||
[self.wakeupButton addTarget:self action:@selector(wakeupButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
[self.wakeupButton addTarget:self action:@selector(wakeupButtonTapped) forControlEvents:UIControlEventPrimaryActionTriggered];
|
||||||
[self addSubview:self.wakeupButton];
|
[self addSubview:self.wakeupButton];
|
||||||
|
|
||||||
@@ -514,7 +516,7 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
self.statusIcon.image = [[UIImage imageNamed:@"wifi_green"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
self.statusIcon.image = [[UIImage imageNamed:@"wifi_green"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
self.statusIcon.hidden = NO;
|
self.statusIcon.hidden = NO;
|
||||||
_hostIconView.tintColor = [UIColor whiteColor];
|
_hostIconView.tintColor = [UIColor whiteColor];
|
||||||
_appButton.titleLabel.font = [UIFont systemFontOfSize:16*_sizeFactor];
|
_appButton.titleLabel.font = [UIFont systemFontOfSize:buttonLabelFontSize];
|
||||||
if(host.pairState == PairStatePaired){
|
if(host.pairState == PairStatePaired){
|
||||||
_iconBackgroundView.backgroundColor = defaultBlue;
|
_iconBackgroundView.backgroundColor = defaultBlue;
|
||||||
lockIconView.hidden = YES;
|
lockIconView.hidden = YES;
|
||||||
|
|||||||
@@ -123,9 +123,6 @@ static const CGFloat cellOffsetY = 20;
|
|||||||
|
|
||||||
- (void)addHost:(TemporaryHost *)host {
|
- (void)addHost:(TemporaryHost *)host {
|
||||||
if(![self.items containsObject:host]){
|
if(![self.items containsObject:host]){
|
||||||
[self.items addObject:host];
|
|
||||||
[self.items addObject:host];
|
|
||||||
[self.items addObject:host];
|
|
||||||
[self.items addObject:host];
|
[self.items addObject:host];
|
||||||
[self.collectionView reloadData];
|
[self.collectionView reloadData];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1548,12 +1548,11 @@ static NSMutableSet* hostList;
|
|||||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
|
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
|
||||||
[self.view addGestureRecognizer:longPress];
|
[self.view addGestureRecognizer:longPress];
|
||||||
|
|
||||||
/*
|
|
||||||
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:[self isIPhone]?@"iPhone":@"iPad" bundle:nil];
|
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:[self isIPhone]?@"iPhone":@"iPad" bundle:nil];
|
||||||
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
|
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
|
||||||
// 强制加载视图
|
// 强制加载视图
|
||||||
__unused UIView *view = viewController.view;
|
__unused UIView *view = viewController.view;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)viewDidLayoutSubviews{
|
-(void)viewDidLayoutSubviews{
|
||||||
|
|||||||
Reference in new issue
Block a user