Created
April 3, 2017 06:51
-
-
Save lululau/90dbffb613c216f046ff14ed37b586b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- mituharu-emacs-mac-b5e5c4a6234d/src/macappkit.m 2017-02-04 13:21:43.000000000 +0800 | |
+++ mituharu-emacs-mac/src/macappkit.m 2017-04-03 14:10:01.000000000 +0800 | |
@@ -1824,6 +1824,18 @@ | |
@implementation EmacsWindow | |
++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask | |
+{ | |
+ | |
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
+ NSString *hideDocumentIcon = [userDefaults stringForKey: @"HideDocumentIcon"]; | |
+ | |
+ if([hideDocumentIcon isEqualToString: @"YES"] && (b == NSWindowDocumentIconButton || b == NSWindowDocumentVersionsButton)) { | |
+ return nil; | |
+ } | |
+ return [NSWindow standardWindowButton:b forStyleMask:styleMask]; | |
+} | |
+ | |
- (instancetype)initWithContentRect:(NSRect)contentRect | |
styleMask:(NSWindowStyleMask)windowStyle | |
backing:(NSBackingStoreType)bufferingType | |
@@ -2267,6 +2279,19 @@ | |
[window setOpaque:NO]; | |
FRAME_BACKGROUND_ALPHA_ENABLED_P (f) = true; | |
} | |
+ | |
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
+ NSString *transparentTitleBar = [userDefaults stringForKey: @"TransparentTitleBar"]; | |
+ | |
+ if ([transparentTitleBar isEqualToString: @"DARK"]) { | |
+ window.titlebarAppearsTransparent = true; | |
+ window.appearance = [NSAppearance appearanceNamed: NSAppearanceNameVibrantDark]; | |
+ } | |
+ | |
+ if ([transparentTitleBar isEqualToString: @"LIGHT"]) { | |
+ window.titlebarAppearsTransparent = true; | |
+ } | |
+ | |
[[window contentView] addSubview:emacsView]; | |
[self updateBackingScaleFactor]; | |
@@ -4498,8 +4523,7 @@ | |
if ([defaults objectForKey:@"ApplePressAndHoldEnabled"] == nil) | |
{ | |
NSDictionaryOf (NSString *, NSString *) *appDefaults = | |
- [NSDictionary dictionaryWithObject:@"NO" | |
- forKey:@"ApplePressAndHoldEnabled"]; | |
+ [NSDictionary dictionaryWithObjectsAndKeys:@"NO", @"ApplePressAndHoldEnabled", @"NO", @"TransparentTitleBar", @"NO", @"HideDocumentIcon", nil]; | |
[defaults registerDefaults:appDefaults]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
emacs-mac升级至25.2后,brew patch报错:
==> Applying emacs-mac-title-bar.patch
patching file src/macappkit.m
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 4523 with fuzz 1.
请问是否要更新patch?