├── .gitignore ├── README.md ├── TTWindow.png ├── TTWindow ├── TTColorView.h ├── TTColorView.m ├── TTWindow.h └── TTWindow.m ├── TTWindow2.png ├── Tinted Titlebar.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata └── Tinted Titlebar ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj ├── Document.xib └── MainMenu.xib ├── Document.h ├── Document.m ├── Images.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | __MACOSX 3 | 4 | # Xcode 5 | */build/* 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | *.hmap 20 | *.xccheckout 21 | 22 | #CocoaPods 23 | Pods 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TTWindow 2 | 3 | A ```NSWindow``` subclass that allows you to set a custom tint color for the titlebar. 4 | 5 | ![Screenshot](https://raw.github.com/insidegui/TTWindow/master/TTWindow.png) 6 | 7 | ![Screenshot 2](https://raw.github.com/insidegui/TTWindow/master/TTWindow2.png) 8 | 9 | **Important: Only works on OS X 10.10 and up** -------------------------------------------------------------------------------- /TTWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insidegui/TTWindow/3a07584c865a5929c8fde61af0d4af46dbc8ffac/TTWindow.png -------------------------------------------------------------------------------- /TTWindow/TTColorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTColorView.h 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TTColorView : NSView 12 | 13 | @property (nonatomic, assign) NSColor *backgroundColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TTWindow/TTColorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTColorView.m 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import "TTColorView.h" 10 | 11 | @implementation TTColorView 12 | 13 | - (void)setBackgroundColor:(NSColor *)backgroundColor 14 | { 15 | _backgroundColor = backgroundColor; 16 | 17 | [self setNeedsDisplay:YES]; 18 | } 19 | 20 | - (void)drawRect:(NSRect)dirtyRect { 21 | [super drawRect:dirtyRect]; 22 | 23 | if (self.backgroundColor) { 24 | [self.backgroundColor setFill]; 25 | } else { 26 | [[NSColor redColor] setFill]; 27 | } 28 | 29 | NSRectFill(dirtyRect); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /TTWindow/TTWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTWindow.h 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TTWindow : NSWindow 12 | 13 | /*! 14 | @property titlebarTintColor 15 | @abstract 16 | The titlebar tint color 17 | */ 18 | @property (nonatomic, assign) NSColor *titlebarTintColor; 19 | 20 | /*! 21 | @property titlebarEffectState 22 | @abstract 23 | NSVisualEffectStateActive - The tint always shows through the titlebar 24 | NSVisualEffectStateInactive - The tint never shows through the titlebar 25 | NSVisualEffectStateFollowsWindowActiveState - The tint shows thorugh the titlebar when the window is active 26 | */ 27 | @property (nonatomic, assign) NSVisualEffectState titlebarEffectState; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TTWindow/TTWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTWindow.m 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import "TTWindow.h" 10 | #import "TTColorView.h" 11 | 12 | #define kTTWindowDefaultTitlebarTintColor [NSColor greenColor] 13 | 14 | @interface TTWindow () 15 | 16 | @property (nonatomic, readonly) NSVisualEffectView *applesTitlebarView; 17 | @property (nonatomic, strong) TTColorView *tintView; 18 | 19 | @end 20 | 21 | @implementation TTWindow 22 | 23 | - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag 24 | { 25 | self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag]; 26 | 27 | if (!self) return nil; 28 | 29 | // start with the default tint color and effect state 30 | self.titlebarTintColor = kTTWindowDefaultTitlebarTintColor; 31 | self.titlebarEffectState = NSVisualEffectStateFollowsWindowActiveState; 32 | 33 | [self setupTitlebarTint]; 34 | 35 | return self; 36 | } 37 | 38 | - (void)setupTitlebarTint 39 | { 40 | // The superview of our contentView is an NSThemeFrame, 41 | // it has an NSTitlebarContainerView, which contains 42 | // an NSTitlebarView. The NSTitlebarView has a visual effect, 43 | // so any view behind It will show through, so we 44 | // insert our tinted view behind It 45 | 46 | // walk through the NSThemeFrame's subviews 47 | for (id view in [[self.contentView superview] subviews]) { 48 | // find the NSTitlebarContainerView 49 | if (![view isKindOfClass:NSClassFromString(@"NSTitlebarContainerView")]) continue; 50 | 51 | // initialize the tinted view 52 | NSRect tintedViewFrame = NSMakeRect(0, 0, NSWidth([view frame]), NSHeight([view frame])); 53 | self.tintView = [[TTColorView alloc] initWithFrame:tintedViewFrame]; 54 | self.tintView.autoresizingMask = NSViewWidthSizable|NSViewHeightSizable; 55 | self.tintView.backgroundColor = self.titlebarTintColor; 56 | 57 | // add the tinted view behind the first subview of the NSTitlebarContainerView 58 | [view addSubview:self.tintView positioned:NSWindowBelow relativeTo:[view subviews][0]]; 59 | } 60 | } 61 | 62 | - (NSVisualEffectView *)applesTitlebarView 63 | { 64 | for (NSView *view in [[self.contentView superview] subviews]) { 65 | if ([view isKindOfClass:NSClassFromString(@"NSTitlebarContainerView")]) { 66 | for (id titlebarView in view.subviews) { 67 | if ([titlebarView isKindOfClass:NSClassFromString(@"NSTitlebarView")]) { 68 | return titlebarView; 69 | } 70 | } 71 | } 72 | } 73 | 74 | return nil; 75 | } 76 | 77 | - (void)setTitlebarTintColor:(NSColor *)titlebarTintColor 78 | { 79 | if (titlebarTintColor == _titlebarTintColor) return; 80 | 81 | _titlebarTintColor = titlebarTintColor; 82 | 83 | self.tintView.backgroundColor = _titlebarTintColor; 84 | } 85 | 86 | - (void)setTitlebarEffectState:(NSVisualEffectState)titlebarEffectState 87 | { 88 | _titlebarEffectState = titlebarEffectState; 89 | 90 | self.applesTitlebarView.state = _titlebarEffectState; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /TTWindow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insidegui/TTWindow/3a07584c865a5929c8fde61af0d4af46dbc8ffac/TTWindow2.png -------------------------------------------------------------------------------- /Tinted Titlebar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DD64634419FE781000EFEFF4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD64634319FE781000EFEFF4 /* AppDelegate.m */; }; 11 | DD64634619FE781000EFEFF4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD64634519FE781000EFEFF4 /* main.m */; }; 12 | DD64634919FE781000EFEFF4 /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = DD64634819FE781000EFEFF4 /* Document.m */; }; 13 | DD64634C19FE781000EFEFF4 /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD64634A19FE781000EFEFF4 /* Document.xib */; }; 14 | DD64634E19FE781000EFEFF4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DD64634D19FE781000EFEFF4 /* Images.xcassets */; }; 15 | DD64635119FE781000EFEFF4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD64634F19FE781000EFEFF4 /* MainMenu.xib */; }; 16 | DD64637119FE7B0A00EFEFF4 /* TTColorView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD64636E19FE7B0A00EFEFF4 /* TTColorView.m */; }; 17 | DD64637219FE7B0A00EFEFF4 /* TTWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = DD64637019FE7B0A00EFEFF4 /* TTWindow.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | DD64633D19FE781000EFEFF4 /* Tinted Titlebar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tinted Titlebar.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | DD64634119FE781000EFEFF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | DD64634219FE781000EFEFF4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | DD64634319FE781000EFEFF4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | DD64634519FE781000EFEFF4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 26 | DD64634719FE781000EFEFF4 /* Document.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Document.h; sourceTree = ""; }; 27 | DD64634819FE781000EFEFF4 /* Document.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Document.m; sourceTree = ""; }; 28 | DD64634B19FE781000EFEFF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Document.xib; sourceTree = ""; }; 29 | DD64634D19FE781000EFEFF4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 30 | DD64635019FE781000EFEFF4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 31 | DD64636D19FE7B0A00EFEFF4 /* TTColorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TTColorView.h; path = TTWindow/TTColorView.h; sourceTree = SOURCE_ROOT; }; 32 | DD64636E19FE7B0A00EFEFF4 /* TTColorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TTColorView.m; path = TTWindow/TTColorView.m; sourceTree = SOURCE_ROOT; }; 33 | DD64636F19FE7B0A00EFEFF4 /* TTWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TTWindow.h; path = TTWindow/TTWindow.h; sourceTree = SOURCE_ROOT; }; 34 | DD64637019FE7B0A00EFEFF4 /* TTWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TTWindow.m; path = TTWindow/TTWindow.m; sourceTree = SOURCE_ROOT; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | DD64633A19FE781000EFEFF4 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | DD64633419FE781000EFEFF4 = { 49 | isa = PBXGroup; 50 | children = ( 51 | DD64633F19FE781000EFEFF4 /* Tinted Titlebar */, 52 | DD64633E19FE781000EFEFF4 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | DD64633E19FE781000EFEFF4 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | DD64633D19FE781000EFEFF4 /* Tinted Titlebar.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | DD64633F19FE781000EFEFF4 /* Tinted Titlebar */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | DD64636619FE781600EFEFF4 /* TTWindow */, 68 | DD64634219FE781000EFEFF4 /* AppDelegate.h */, 69 | DD64634319FE781000EFEFF4 /* AppDelegate.m */, 70 | DD64634719FE781000EFEFF4 /* Document.h */, 71 | DD64634819FE781000EFEFF4 /* Document.m */, 72 | DD64634A19FE781000EFEFF4 /* Document.xib */, 73 | DD64634D19FE781000EFEFF4 /* Images.xcassets */, 74 | DD64634F19FE781000EFEFF4 /* MainMenu.xib */, 75 | DD64634019FE781000EFEFF4 /* Supporting Files */, 76 | ); 77 | path = "Tinted Titlebar"; 78 | sourceTree = ""; 79 | }; 80 | DD64634019FE781000EFEFF4 /* Supporting Files */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | DD64634119FE781000EFEFF4 /* Info.plist */, 84 | DD64634519FE781000EFEFF4 /* main.m */, 85 | ); 86 | name = "Supporting Files"; 87 | sourceTree = ""; 88 | }; 89 | DD64636619FE781600EFEFF4 /* TTWindow */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | DD64636D19FE7B0A00EFEFF4 /* TTColorView.h */, 93 | DD64636E19FE7B0A00EFEFF4 /* TTColorView.m */, 94 | DD64636F19FE7B0A00EFEFF4 /* TTWindow.h */, 95 | DD64637019FE7B0A00EFEFF4 /* TTWindow.m */, 96 | ); 97 | name = TTWindow; 98 | sourceTree = ""; 99 | }; 100 | /* End PBXGroup section */ 101 | 102 | /* Begin PBXNativeTarget section */ 103 | DD64633C19FE781000EFEFF4 /* Tinted Titlebar */ = { 104 | isa = PBXNativeTarget; 105 | buildConfigurationList = DD64636019FE781000EFEFF4 /* Build configuration list for PBXNativeTarget "Tinted Titlebar" */; 106 | buildPhases = ( 107 | DD64633919FE781000EFEFF4 /* Sources */, 108 | DD64633A19FE781000EFEFF4 /* Frameworks */, 109 | DD64633B19FE781000EFEFF4 /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = "Tinted Titlebar"; 116 | productName = "Tinted Titlebar"; 117 | productReference = DD64633D19FE781000EFEFF4 /* Tinted Titlebar.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | DD64633519FE781000EFEFF4 /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | LastUpgradeCheck = 0610; 127 | ORGANIZATIONNAME = "Guilherme Rambo"; 128 | TargetAttributes = { 129 | DD64633C19FE781000EFEFF4 = { 130 | CreatedOnToolsVersion = 6.1; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = DD64633819FE781000EFEFF4 /* Build configuration list for PBXProject "Tinted Titlebar" */; 135 | compatibilityVersion = "Xcode 3.2"; 136 | developmentRegion = English; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = DD64633419FE781000EFEFF4; 143 | productRefGroup = DD64633E19FE781000EFEFF4 /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | DD64633C19FE781000EFEFF4 /* Tinted Titlebar */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | DD64633B19FE781000EFEFF4 /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | DD64634C19FE781000EFEFF4 /* Document.xib in Resources */, 158 | DD64634E19FE781000EFEFF4 /* Images.xcassets in Resources */, 159 | DD64635119FE781000EFEFF4 /* MainMenu.xib in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | DD64633919FE781000EFEFF4 /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | DD64634919FE781000EFEFF4 /* Document.m in Sources */, 171 | DD64634619FE781000EFEFF4 /* main.m in Sources */, 172 | DD64637219FE7B0A00EFEFF4 /* TTWindow.m in Sources */, 173 | DD64637119FE7B0A00EFEFF4 /* TTColorView.m in Sources */, 174 | DD64634419FE781000EFEFF4 /* AppDelegate.m in Sources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXSourcesBuildPhase section */ 179 | 180 | /* Begin PBXVariantGroup section */ 181 | DD64634A19FE781000EFEFF4 /* Document.xib */ = { 182 | isa = PBXVariantGroup; 183 | children = ( 184 | DD64634B19FE781000EFEFF4 /* Base */, 185 | ); 186 | name = Document.xib; 187 | sourceTree = ""; 188 | }; 189 | DD64634F19FE781000EFEFF4 /* MainMenu.xib */ = { 190 | isa = PBXVariantGroup; 191 | children = ( 192 | DD64635019FE781000EFEFF4 /* Base */, 193 | ); 194 | name = MainMenu.xib; 195 | sourceTree = ""; 196 | }; 197 | /* End PBXVariantGroup section */ 198 | 199 | /* Begin XCBuildConfiguration section */ 200 | DD64635E19FE781000EFEFF4 /* Debug */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 204 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 205 | CLANG_CXX_LIBRARY = "libc++"; 206 | CLANG_ENABLE_MODULES = YES; 207 | CLANG_ENABLE_OBJC_ARC = YES; 208 | CLANG_WARN_BOOL_CONVERSION = YES; 209 | CLANG_WARN_CONSTANT_CONVERSION = YES; 210 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INT_CONVERSION = YES; 214 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 215 | CLANG_WARN_UNREACHABLE_CODE = YES; 216 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 217 | CODE_SIGN_IDENTITY = "-"; 218 | COPY_PHASE_STRIP = NO; 219 | ENABLE_STRICT_OBJC_MSGSEND = YES; 220 | GCC_C_LANGUAGE_STANDARD = gnu99; 221 | GCC_DYNAMIC_NO_PIC = NO; 222 | GCC_OPTIMIZATION_LEVEL = 0; 223 | GCC_PREPROCESSOR_DEFINITIONS = ( 224 | "DEBUG=1", 225 | "$(inherited)", 226 | ); 227 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 230 | GCC_WARN_UNDECLARED_SELECTOR = YES; 231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 232 | GCC_WARN_UNUSED_FUNCTION = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | MACOSX_DEPLOYMENT_TARGET = 10.10; 235 | MTL_ENABLE_DEBUG_INFO = YES; 236 | ONLY_ACTIVE_ARCH = YES; 237 | SDKROOT = macosx; 238 | }; 239 | name = Debug; 240 | }; 241 | DD64635F19FE781000EFEFF4 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 246 | CLANG_CXX_LIBRARY = "libc++"; 247 | CLANG_ENABLE_MODULES = YES; 248 | CLANG_ENABLE_OBJC_ARC = YES; 249 | CLANG_WARN_BOOL_CONVERSION = YES; 250 | CLANG_WARN_CONSTANT_CONVERSION = YES; 251 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 256 | CLANG_WARN_UNREACHABLE_CODE = YES; 257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 258 | CODE_SIGN_IDENTITY = "-"; 259 | COPY_PHASE_STRIP = YES; 260 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 261 | ENABLE_NS_ASSERTIONS = NO; 262 | ENABLE_STRICT_OBJC_MSGSEND = YES; 263 | GCC_C_LANGUAGE_STANDARD = gnu99; 264 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 266 | GCC_WARN_UNDECLARED_SELECTOR = YES; 267 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 268 | GCC_WARN_UNUSED_FUNCTION = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | MACOSX_DEPLOYMENT_TARGET = 10.10; 271 | MTL_ENABLE_DEBUG_INFO = NO; 272 | SDKROOT = macosx; 273 | }; 274 | name = Release; 275 | }; 276 | DD64636119FE781000EFEFF4 /* Debug */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 280 | COMBINE_HIDPI_IMAGES = YES; 281 | INFOPLIST_FILE = "Tinted Titlebar/Info.plist"; 282 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | }; 285 | name = Debug; 286 | }; 287 | DD64636219FE781000EFEFF4 /* Release */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | COMBINE_HIDPI_IMAGES = YES; 292 | INFOPLIST_FILE = "Tinted Titlebar/Info.plist"; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 294 | PRODUCT_NAME = "$(TARGET_NAME)"; 295 | }; 296 | name = Release; 297 | }; 298 | /* End XCBuildConfiguration section */ 299 | 300 | /* Begin XCConfigurationList section */ 301 | DD64633819FE781000EFEFF4 /* Build configuration list for PBXProject "Tinted Titlebar" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | DD64635E19FE781000EFEFF4 /* Debug */, 305 | DD64635F19FE781000EFEFF4 /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | DD64636019FE781000EFEFF4 /* Build configuration list for PBXNativeTarget "Tinted Titlebar" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | DD64636119FE781000EFEFF4 /* Debug */, 314 | DD64636219FE781000EFEFF4 /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = DD64633519FE781000EFEFF4 /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /Tinted Titlebar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Tinted Titlebar/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Tinted Titlebar/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | } 20 | 21 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 22 | // Insert code here to tear down your application 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Tinted Titlebar/Base.lproj/Document.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Tinted Titlebar/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | Default 535 | 536 | 537 | 538 | 539 | 540 | 541 | Left to Right 542 | 543 | 544 | 545 | 546 | 547 | 548 | Right to Left 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | Default 560 | 561 | 562 | 563 | 564 | 565 | 566 | Left to Right 567 | 568 | 569 | 570 | 571 | 572 | 573 | Right to Left 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | -------------------------------------------------------------------------------- /Tinted Titlebar/Document.h: -------------------------------------------------------------------------------- 1 | // 2 | // Document.h 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Document : NSDocument 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Tinted Titlebar/Document.m: -------------------------------------------------------------------------------- 1 | // 2 | // Document.m 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import "Document.h" 10 | #import "TTWindow.h" 11 | 12 | @interface Document () 13 | 14 | @property (readonly) TTWindow *specialWindow; 15 | @property (weak) IBOutlet NSColorWell *colorWell; 16 | 17 | @end 18 | 19 | @implementation Document 20 | 21 | - (TTWindow *)specialWindow 22 | { 23 | return (TTWindow *)self.windowForSheet; 24 | } 25 | 26 | - (IBAction)colorWellAction:(id)sender { 27 | self.specialWindow.titlebarTintColor = self.colorWell.color; 28 | } 29 | 30 | - (IBAction)checkboxAction:(id)sender { 31 | if ([sender state] == NSOnState) { 32 | self.specialWindow.titlebarEffectState = NSVisualEffectStateActive; 33 | } else { 34 | self.specialWindow.titlebarEffectState = NSVisualEffectStateFollowsWindowActiveState; 35 | } 36 | } 37 | 38 | - (void)windowControllerDidLoadNib:(NSWindowController *)aController { 39 | [super windowControllerDidLoadNib:aController]; 40 | 41 | self.windowForSheet.backgroundColor = [NSColor whiteColor]; 42 | } 43 | 44 | + (BOOL)autosavesInPlace { 45 | return YES; 46 | } 47 | 48 | - (NSString *)windowNibName { 49 | return @"Document"; 50 | } 51 | 52 | - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { 53 | return [NSData data]; 54 | } 55 | 56 | - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { 57 | return YES; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Tinted Titlebar/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Tinted Titlebar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | txt 13 | 14 | CFBundleTypeIconFile 15 | 16 | CFBundleTypeName 17 | DocumentType 18 | CFBundleTypeOSTypes 19 | 20 | ???? 21 | 22 | CFBundleTypeRole 23 | Editor 24 | NSDocumentClass 25 | Document 26 | 27 | 28 | CFBundleExecutable 29 | $(EXECUTABLE_NAME) 30 | CFBundleIconFile 31 | 32 | CFBundleIdentifier 33 | br.com.guilhermerambo.$(PRODUCT_NAME:rfc1034identifier) 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundleName 37 | $(PRODUCT_NAME) 38 | CFBundlePackageType 39 | APPL 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1 46 | LSMinimumSystemVersion 47 | $(MACOSX_DEPLOYMENT_TARGET) 48 | NSHumanReadableCopyright 49 | Copyright © 2014 Guilherme Rambo. All rights reserved. 50 | NSMainNibFile 51 | MainMenu 52 | NSPrincipalClass 53 | NSApplication 54 | 55 | 56 | -------------------------------------------------------------------------------- /Tinted Titlebar/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Tinted Titlebar 4 | // 5 | // Created by Guilherme Rambo on 27/10/14. 6 | // Copyright (c) 2014 Guilherme Rambo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | --------------------------------------------------------------------------------