diff options
author | Damiano Galassi <[email protected]> | 2015-10-03 11:33:20 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-03 11:33:20 +0200 |
commit | 012ee4716df95a49ae511160a289b0ac57597a6d (patch) | |
tree | e6c9ae436d4ae7dd003bfd39df568c34abc7e173 /macosx/HBPictureViewController.m | |
parent | 875aec0db2138f374dbd6987b02f000595caddf7 (diff) |
MacGui: change the picture tab label color to gray when no source is loaded
Diffstat (limited to 'macosx/HBPictureViewController.m')
-rw-r--r-- | macosx/HBPictureViewController.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/macosx/HBPictureViewController.m b/macosx/HBPictureViewController.m index 3739cfc68..344580ec6 100644 --- a/macosx/HBPictureViewController.m +++ b/macosx/HBPictureViewController.m @@ -17,6 +17,8 @@ static void *HBPictureViewControllerContext = &HBPictureViewControllerContext; @property (weak) IBOutlet NSStepper *widthStepper; @property (weak) IBOutlet NSStepper *heightStepper; +@property (nonatomic, readwrite) NSColor *labelColor; + @end @implementation HBPictureViewController @@ -26,6 +28,7 @@ static void *HBPictureViewControllerContext = &HBPictureViewControllerContext; self = [super initWithNibName:@"HBPictureViewController" bundle:nil]; if (self) { + _labelColor = [NSColor disabledControlTextColor]; [self addObserver:self forKeyPath:@"self.picture.modulus" options:NSKeyValueObservingOptionInitial context:HBPictureViewControllerContext]; } return self; @@ -40,6 +43,21 @@ static void *HBPictureViewControllerContext = &HBPictureViewControllerContext; @catch (NSException * __unused exception) {} } +- (void)setPicture:(HBPicture *)picture +{ + _picture = picture; + + if (_picture) + { + self.labelColor = [NSColor controlTextColor]; + } + else + { + self.labelColor = [NSColor disabledControlTextColor]; + } + +} + #pragma mark - KVO - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context |