Fix ComboBox highlight color.
This commit is contained in:
1 parent
d53b0d6ad0
commit
eb7d2c5ba7
9 files changed
+159
-30
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16C41b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
@@ -236,7 +236,7 @@
|
||||
<comboBox verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xf4-ll-Tkp">
|
||||
<rect key="frame" x="3" y="-5" width="135" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="right" buttonBordered="NO" completes="NO" usesDataSource="YES" numberOfVisibleItems="8" id="FqY-5W-MnQ">
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="right" buttonBordered="NO" completes="NO" usesDataSource="YES" numberOfVisibleItems="8" id="FqY-5W-MnQ" customClass="SBComboBoxCell">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16C41b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
@@ -99,7 +99,7 @@
|
||||
<subviews>
|
||||
<tokenField verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3sj-gY-zSo">
|
||||
<rect key="frame" x="1" y="1" width="205" height="16"/>
|
||||
<tokenFieldCell key="cell" selectable="YES" editable="YES" alignment="left" allowsEditingTextAttributes="YES" id="BaM-xn-Wzr">
|
||||
<tokenFieldCell key="cell" selectable="YES" editable="YES" alignment="left" allowsEditingTextAttributes="YES" id="BaM-xn-Wzr" customClass="SBTokenFieldCell">
|
||||
<font key="font" metaFont="cellTitle"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -290,7 +290,7 @@
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="120" id="MKe-YL-gx8"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="smallSquare" title="Restore Defaults" bezelStyle="smallSquare" image="3CE2261F-EE3E-4371-A1F2-F22FF32A83B6" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nBh-jv-KDG">
|
||||
<buttonCell key="cell" type="smallSquare" title="Restore Defaults" bezelStyle="smallSquare" image="967F5272-ECFD-4F7A-BDF2-A03AEEEF0C42" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nBh-jv-KDG">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
@@ -342,7 +342,7 @@
|
||||
<userDefaultsController representsSharedInstance="YES" id="LQR-UU-5Gl"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="3CE2261F-EE3E-4371-A1F2-F22FF32A83B6" width="1" height="1">
|
||||
<image name="967F5272-ECFD-4F7A-BDF2-A03AEEEF0C42" width="1" height="1">
|
||||
<mutableData key="keyedArchiveRepresentation">
|
||||
YnBsaXN0MDDUAQIDBAUGPT5YJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK4HCBMU
|
||||
GR4fIyQrLjE3OlUkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5TUmVw
|
||||
|
||||
@@ -206,14 +206,14 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<popUpButton fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cFv-4U-VzM">
|
||||
<rect key="frame" x="0.0" y="-4" width="316" height="22"/>
|
||||
<rect key="frame" x="0.0" y="-2" width="316" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="bevel" title="Do not localize" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" imageScaling="proportionallyDown" inset="2" selectedItem="6Zb-NM-Mmo" id="Myn-C3-tc4">
|
||||
<popUpButtonCell key="cell" type="bevel" title="Do not localize" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" imageScaling="proportionallyDown" inset="2" selectedItem="6Zb-NM-Mmo" id="Myn-C3-tc4">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<menu key="menu" id="qwD-bC-Vmw">
|
||||
<items>
|
||||
<menuItem title="Do not localize" id="6Zb-NM-Mmo"/>
|
||||
<menuItem title="Do not localize" state="on" id="6Zb-NM-Mmo"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
@@ -251,9 +251,9 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<comboBox verticalHuggingPriority="750" fixedFrame="YES" preferredMaxLayoutWidth="1000" translatesAutoresizingMaskIntoConstraints="NO" id="LbC-r6-Pau">
|
||||
<rect key="frame" x="3" y="-1" width="319" height="19"/>
|
||||
<rect key="frame" x="3" y="0" width="319" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<comboBoxCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="border" alignment="left" title="Do not localize" usesSingleLineMode="YES" buttonBordered="NO" completes="NO" numberOfVisibleItems="5" id="jkg-xz-Hbn">
|
||||
<comboBoxCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" title="Do not localize" usesSingleLineMode="YES" buttonBordered="NO" completes="NO" numberOfVisibleItems="5" id="jkg-xz-Hbn" customClass="SBComboBoxCell">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// SBComboBoxCell.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 10/11/16.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SBComboBoxCell : NSComboBoxCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// SBComboBoxCell.m
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 10/11/16.
|
||||
//
|
||||
//
|
||||
|
||||
#import "SBComboBoxCell.h"
|
||||
|
||||
@interface SBComboBoxCell ()
|
||||
|
||||
@property (nonatomic) NSBackgroundStyle SB_originalBackgroundStyle;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBComboBoxCell
|
||||
|
||||
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle
|
||||
{
|
||||
[super setBackgroundStyle:backgroundStyle];
|
||||
if (backgroundStyle == NSBackgroundStyleDark) {
|
||||
self.textColor = [NSColor controlHighlightColor];
|
||||
}
|
||||
else {
|
||||
self.textColor = [NSColor controlTextColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj;
|
||||
{
|
||||
self.SB_originalBackgroundStyle = self.backgroundStyle;
|
||||
|
||||
self.backgroundStyle = NSBackgroundStyleLight;
|
||||
self.drawsBackground = YES;
|
||||
|
||||
return [super setUpFieldEditorAttributes:textObj];
|
||||
}
|
||||
|
||||
- (void)endEditing:(NSText *)textObj
|
||||
{
|
||||
[super endEditing:textObj];
|
||||
self.drawsBackground = NO;
|
||||
self.backgroundStyle = self.SB_originalBackgroundStyle;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -10,15 +10,4 @@
|
||||
|
||||
@implementation SBComboBoxCellView
|
||||
|
||||
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle
|
||||
{
|
||||
[super setBackgroundStyle:backgroundStyle];
|
||||
if (backgroundStyle == NSBackgroundStyleDark) {
|
||||
self.comboBox.textColor = [NSColor controlHighlightColor];
|
||||
}
|
||||
else {
|
||||
self.comboBox.textColor = [NSColor controlTextColor];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// SBTokenFieldCell.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 10/11/16.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SBTokenFieldCell : NSTokenFieldCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// SBTokenFieldCell.m
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 10/11/16.
|
||||
//
|
||||
//
|
||||
|
||||
#import "SBTokenFieldCell.h"
|
||||
|
||||
@interface SBTokenFieldCell ()
|
||||
|
||||
@property (nonatomic) NSBackgroundStyle SB_originalBackgroundStyle;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBTokenFieldCell
|
||||
|
||||
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle
|
||||
{
|
||||
[super setBackgroundStyle:backgroundStyle];
|
||||
if (backgroundStyle == NSBackgroundStyleDark) {
|
||||
self.textColor = [NSColor controlHighlightColor];
|
||||
}
|
||||
else {
|
||||
self.textColor = [NSColor controlTextColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj;
|
||||
{
|
||||
self.SB_originalBackgroundStyle = self.backgroundStyle;
|
||||
|
||||
self.backgroundStyle = NSBackgroundStyleLight;
|
||||
self.drawsBackground = YES;
|
||||
|
||||
return [super setUpFieldEditorAttributes:textObj];
|
||||
}
|
||||
|
||||
- (void)endEditing:(NSText *)textObj
|
||||
{
|
||||
[super endEditing:textObj];
|
||||
self.drawsBackground = NO;
|
||||
self.backgroundStyle = self.SB_originalBackgroundStyle;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -16,6 +16,8 @@
|
||||
A901C51F1C04F03F00430DC3 /* SBChapterImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = A901C51D1C04F03F00430DC3 /* SBChapterImporter.m */; };
|
||||
A90300C41DAE6E27008237D8 /* SBSetPrefsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A90300C21DAE6E27008237D8 /* SBSetPrefsViewController.m */; };
|
||||
A90300C81DAE72C4008237D8 /* SBSetPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90300CA1DAE72C4008237D8 /* SBSetPrefsViewController.xib */; };
|
||||
A909440A1DD4B80000E9F89C /* SBComboBoxCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A90944091DD4B80000E9F89C /* SBComboBoxCell.m */; };
|
||||
A909440D1DD4C70900E9F89C /* SBTokenFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A909440C1DD4C70900E9F89C /* SBTokenFieldCell.m */; };
|
||||
A90B023B10F3290A000416F3 /* Prefs.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90B023910F3290A000416F3 /* Prefs.xib */; };
|
||||
A91690041DABFDAA004B9AB0 /* SBCheckBoxCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A91690031DABFDAA004B9AB0 /* SBCheckBoxCellView.m */; };
|
||||
A917286119FD288B00348DF8 /* SBLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = A917286019FD288B00348DF8 /* SBLogger.m */; };
|
||||
@@ -171,6 +173,10 @@
|
||||
A90300C11DAE6E27008237D8 /* SBSetPrefsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSetPrefsViewController.h; path = Classes/SBSetPrefsViewController.h; sourceTree = "<group>"; };
|
||||
A90300C21DAE6E27008237D8 /* SBSetPrefsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBSetPrefsViewController.m; path = Classes/SBSetPrefsViewController.m; sourceTree = "<group>"; };
|
||||
A90300C91DAE72C4008237D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SBSetPrefsViewController.xib; sourceTree = "<group>"; };
|
||||
A90944081DD4B80000E9F89C /* SBComboBoxCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBComboBoxCell.h; path = Classes/SBComboBoxCell.h; sourceTree = "<group>"; };
|
||||
A90944091DD4B80000E9F89C /* SBComboBoxCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBComboBoxCell.m; path = Classes/SBComboBoxCell.m; sourceTree = "<group>"; };
|
||||
A909440B1DD4C70900E9F89C /* SBTokenFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTokenFieldCell.h; path = Classes/SBTokenFieldCell.h; sourceTree = "<group>"; };
|
||||
A909440C1DD4C70900E9F89C /* SBTokenFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBTokenFieldCell.m; path = Classes/SBTokenFieldCell.m; sourceTree = "<group>"; };
|
||||
A91690021DABFDAA004B9AB0 /* SBCheckBoxCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCheckBoxCellView.h; path = Classes/SBCheckBoxCellView.h; sourceTree = "<group>"; };
|
||||
A91690031DABFDAA004B9AB0 /* SBCheckBoxCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBCheckBoxCellView.m; path = Classes/SBCheckBoxCellView.m; sourceTree = "<group>"; };
|
||||
A917286019FD288B00348DF8 /* SBLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBLogger.m; path = Classes/SBLogger.m; sourceTree = "<group>"; };
|
||||
@@ -454,6 +460,25 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A909440E1DD4C85B00E9F89C /* Table View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A93DD7661DACCE930052749A /* SBComboBoxCellView.h */,
|
||||
A93DD7671DACCE930052749A /* SBComboBoxCellView.m */,
|
||||
A90944081DD4B80000E9F89C /* SBComboBoxCell.h */,
|
||||
A90944091DD4B80000E9F89C /* SBComboBoxCell.m */,
|
||||
A91690021DABFDAA004B9AB0 /* SBCheckBoxCellView.h */,
|
||||
A91690031DABFDAA004B9AB0 /* SBCheckBoxCellView.m */,
|
||||
A909440B1DD4C70900E9F89C /* SBTokenFieldCell.h */,
|
||||
A909440C1DD4C70900E9F89C /* SBTokenFieldCell.m */,
|
||||
A9B75B8C1DAD1B140031798B /* SBPopUpCellView.h */,
|
||||
A9B75B8D1DAD1B140031798B /* SBPopUpCellView.m */,
|
||||
A9B46A8412B79B240040517A /* SBTableView.h */,
|
||||
A9B46A8512B79B240040517A /* SBTableView.m */,
|
||||
);
|
||||
name = "Table View";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A925AA7C18378D7800BE84D4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -571,6 +596,7 @@
|
||||
CD56963112FAAD680029FADB /* SBArtworkSelector.m */,
|
||||
A9D4B8621C05BC61007845C4 /* SBChapterSearchController.h */,
|
||||
A9D4B8631C05BC61007845C4 /* SBChapterSearchController.m */,
|
||||
A909440E1DD4C85B00E9F89C /* Table View */,
|
||||
A9FD5D150F3C692400817716 /* PropertyView */,
|
||||
);
|
||||
name = Document;
|
||||
@@ -593,14 +619,6 @@
|
||||
A9AB485317F0AEAC000AA72E /* SBVideoViewController.m */,
|
||||
A960E96117D4B00900FC6ED9 /* SBImageBrowserView.h */,
|
||||
A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */,
|
||||
A93DD7661DACCE930052749A /* SBComboBoxCellView.h */,
|
||||
A93DD7671DACCE930052749A /* SBComboBoxCellView.m */,
|
||||
A91690021DABFDAA004B9AB0 /* SBCheckBoxCellView.h */,
|
||||
A91690031DABFDAA004B9AB0 /* SBCheckBoxCellView.m */,
|
||||
A9B75B8C1DAD1B140031798B /* SBPopUpCellView.h */,
|
||||
A9B75B8D1DAD1B140031798B /* SBPopUpCellView.m */,
|
||||
A9B46A8412B79B240040517A /* SBTableView.h */,
|
||||
A9B46A8512B79B240040517A /* SBTableView.m */,
|
||||
A9B46A8612B79B240040517A /* SBView.h */,
|
||||
A9B46A8712B79B240040517A /* SBView.m */,
|
||||
);
|
||||
@@ -877,6 +895,7 @@
|
||||
A9C703121C05E08B00C89151 /* SBMetadataHelper.m in Sources */,
|
||||
CD71FEA312F1B5AF00F0A98D /* SBMetadataSearchController.m in Sources */,
|
||||
CD71FF1D12F1C4A900F0A98D /* SBTheTVDB.m in Sources */,
|
||||
A909440D1DD4C70900E9F89C /* SBTokenFieldCell.m in Sources */,
|
||||
A9C5FA6E19FA22590051F3FF /* SBLogWindowController.m in Sources */,
|
||||
A9D73C5218BF3F1100C6FFA6 /* SBQueue.m in Sources */,
|
||||
A9AB485717F0AEAC000AA72E /* SBSoundViewController.m in Sources */,
|
||||
@@ -894,6 +913,7 @@
|
||||
A90300C41DAE6E27008237D8 /* SBSetPrefsViewController.m in Sources */,
|
||||
CDC06FCE1747494D003C1D0A /* SBiTunesStore.m in Sources */,
|
||||
A917286119FD288B00348DF8 /* SBLogger.m in Sources */,
|
||||
A909440A1DD4B80000E9F89C /* SBComboBoxCell.m in Sources */,
|
||||
A9D4B8641C05BC61007845C4 /* SBChapterSearchController.m in Sources */,
|
||||
CD03087417576A550093A0BE /* SBTheMovieDB3.m in Sources */,
|
||||
A9EEA5F218D65490008B54B4 /* SBOptionsViewController.m in Sources */,
|
||||
|
||||
Reference in new issue
Block a user