diff options
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 |