mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge pull request #111 from macvim-dev/feature/no_title_bar_window
MMNoTitleBarWindowKey for hiding titlebar
This commit is contained in:
@@ -108,6 +108,14 @@ static CGSSetWindowBackgroundBlurRadiusFunction* GetCGSSetWindowBackgroundBlurRa
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) canBecomeMainWindow {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) canBecomeKeyWindow {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)hideTablineSeparator:(BOOL)hide
|
||||
{
|
||||
BOOL isHidden = [tablineSeparator isHidden];
|
||||
@@ -227,4 +235,15 @@ static CGSSetWindowBackgroundBlurRadiusFunction* GetCGSSetWindowBackgroundBlurRa
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)setToolbar:(NSToolbar *)toolbar
|
||||
{
|
||||
if ([[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMNoTitleBarWindowKey]) {
|
||||
// MacVim can't have toolbar with No title bar setting.
|
||||
return;
|
||||
}
|
||||
|
||||
[super setToolbar:toolbar];
|
||||
}
|
||||
|
||||
@end // MMWindow
|
||||
|
||||
@@ -130,6 +130,12 @@
|
||||
| NSMiniaturizableWindowMask | NSResizableWindowMask
|
||||
| NSUnifiedTitleAndToolbarWindowMask;
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMNoTitleBarWindowKey]) {
|
||||
// No title bar setting
|
||||
styleMask &= ~NSTitledWindowMask;
|
||||
}
|
||||
|
||||
// Use textured background on Leopard or later (skip the 'if' on Tiger for
|
||||
// polished metal window).
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:MMTexturedWindowKey]
|
||||
|
||||
@@ -37,6 +37,7 @@ extern NSString *MMTranslateCtrlClickKey;
|
||||
extern NSString *MMTopLeftPointKey;
|
||||
extern NSString *MMOpenInCurrentWindowKey;
|
||||
extern NSString *MMNoFontSubstitutionKey;
|
||||
extern NSString *MMNoTitleBarWindowKey;
|
||||
extern NSString *MMLoginShellKey;
|
||||
extern NSString *MMUntitledWindowKey;
|
||||
extern NSString *MMTexturedWindowKey;
|
||||
|
||||
@@ -29,6 +29,7 @@ NSString *MMTranslateCtrlClickKey = @"MMTranslateCtrlClick";
|
||||
NSString *MMTopLeftPointKey = @"MMTopLeftPoint";
|
||||
NSString *MMOpenInCurrentWindowKey = @"MMOpenInCurrentWindow";
|
||||
NSString *MMNoFontSubstitutionKey = @"MMNoFontSubstitution";
|
||||
NSString *MMNoTitleBarWindowKey = @"MMNoTitleBarWindow";
|
||||
NSString *MMLoginShellKey = @"MMLoginShell";
|
||||
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
|
||||
NSString *MMTexturedWindowKey = @"MMTexturedWindow";
|
||||
|
||||
Reference in New Issue
Block a user