Permalink
Browse files

disable menu item when True Tone is supported but not available

  • Loading branch information...
thompsonate committed Sep 5, 2018
1 parent 33b30f2 commit 7a6b5f00861e9a1ffef5319d1273e0d067336f69
Showing with 6 additions and 0 deletions.
  1. +1 −0 Shifty/CBTrueToneClient.h
  2. +1 −0 Shifty/StatusMenuController.swift
  3. +4 −0 Shifty/TrueToneClient+Shifty.swift
@@ -9,6 +9,7 @@
@interface CBTrueToneClient : NSObject
- (BOOL)available;
- (BOOL)supported;
- (BOOL)enabled;
- (BOOL)setEnabled:(BOOL)arg1;
@end
@@ -91,6 +91,7 @@ class StatusMenuController: NSObject, NSMenuDelegate {
} else {
trueToneMenuItem.title = "Turn on True Tone"
}
trueToneMenuItem.isEnabled = CBTrueToneClient.shared.isTrueToneAvailable
} else {
trueToneMenuItem.isHidden = true
}
@@ -11,6 +11,10 @@ extension CBTrueToneClient {
static var shared = CBTrueToneClient()
var isTrueToneSupported: Bool {
return CBTrueToneClient.shared.supported()
}
var isTrueToneAvailable: Bool {
return CBTrueToneClient.shared.available()
}

0 comments on commit 7a6b5f0

Please sign in to comment.