diff --git a/VoidLink/HostCardView.m b/VoidLink/HostCardView.m index ff4852e2..061394de 100644 --- a/VoidLink/HostCardView.m +++ b/VoidLink/HostCardView.m @@ -521,6 +521,8 @@ static const float REFRESH_CYCLE = 2.0f; _hostNameLabel.text = host.name; backgroundLayer.hidden = !(host.state == StateOnline && host.pairState == PairStatePaired); + BOOL hostPaired = host.pairState == PairStatePaired; + switch (host.state) { case StateOnline: [_hostSpinner stopAnimating]; @@ -576,8 +578,6 @@ static const float REFRESH_CYCLE = 2.0f; self.statusIcon.hidden = YES; } - bool hostPaired = host.pairState == PairStatePaired; - _hostIconView.tintColor = [ThemeManager lowProfileGray]; lockIconView.tintColor = [ThemeManager lowProfileGray]; lockIconView.hidden = hostPaired; @@ -620,17 +620,16 @@ static const float REFRESH_CYCLE = 2.0f; _pairButton.hidden = YES; _wakeupButton.hidden = NO; - [_wakeupButton setTitleColor:[ThemeManager textColorGray] forState:UIControlStateNormal]; // theme if (@available(iOS 13.0, *)) { UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:buttonHeight/3.45 weight:UIImageSymbolWeightBold]; UIImage *templateImage = [UIImage systemImageNamed:@"power" withConfiguration:config]; - UIImage *coloredImage = [templateImage imageWithTintColor:[ThemeManager textColorGray] renderingMode:UIImageRenderingModeAlwaysOriginal]; + UIImage *coloredImage = [templateImage imageWithTintColor:hostPaired ? defaultBlue : [ThemeManager textColorGray] renderingMode:UIImageRenderingModeAlwaysOriginal]; [self.wakeupButton setImage:coloredImage forState:UIControlStateNormal]; } else { // Fallback on earlier versions } - self.wakeupButton.backgroundColor = [[ThemeManager textColorGray] colorWithAlphaComponent:0.2]; - [self.wakeupButton setTitleColor:[ThemeManager textColorGray] forState:UIControlStateNormal]; + self.wakeupButton.backgroundColor = hostPaired ? [ThemeManager textTintColorWithAlpha] : [[ThemeManager textColorGray] colorWithAlphaComponent:0.2]; + [self.wakeupButton setTitleColor: hostPaired ? defaultBlue : [ThemeManager textColorGray] forState:UIControlStateNormal]; break; default:break; } diff --git a/VoidLink/ViewControllers/MainFrameViewController.m b/VoidLink/ViewControllers/MainFrameViewController.m index d49bd450..1394bd0f 100644 --- a/VoidLink/ViewControllers/MainFrameViewController.m +++ b/VoidLink/ViewControllers/MainFrameViewController.m @@ -409,7 +409,7 @@ static NSMutableSet* hostList; - (void)wakeupButtonTappedForHost:(TemporaryHost *)host{ _selectedHost = host; - if (host.state == StateOffline && host.pairState == PairStatePaired) { + if ((host.state == StateOffline || host.state == StateUnknown) && host.pairState == PairStatePaired) { UIAlertController* wolAlert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Wake-On-LAN"] message:@"" preferredStyle:UIAlertControllerStyleAlert]; [wolAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:nil]]; if (host.mac == nil || [host.mac isEqualToString:@"00:00:00:00:00:00"]) {