2023-02-11 20:49:42 +00:00
|
|
|
// This file Copyright © 2008-2023 Transmission authors and contributors.
|
2022-01-20 18:27:56 +00:00
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2008-06-17 21:09:06 +00:00
|
|
|
|
|
|
|
#import "ColorTextField.h"
|
|
|
|
|
|
|
|
@implementation ColorTextField
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)awakeFromNib
|
2008-06-17 21:09:06 +00:00
|
|
|
{
|
2021-08-07 07:27:56 +00:00
|
|
|
self.enabled = self.enabled;
|
2008-06-17 21:09:06 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)setEnabled:(BOOL)flag
|
2008-06-17 21:09:06 +00:00
|
|
|
{
|
2021-08-07 07:27:56 +00:00
|
|
|
super.enabled = flag;
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
NSColor* color = flag ? NSColor.controlTextColor : NSColor.disabledControlTextColor;
|
2021-08-07 07:27:56 +00:00
|
|
|
self.textColor = color;
|
2008-06-17 21:09:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|