Skip to content

Commit 9731c2a

Browse files
committed
Add option to enable a transparent titlebar #884
1 parent 5bc878d commit 9731c2a

File tree

5 files changed

+44
-34
lines changed

5 files changed

+44
-34
lines changed

runtime/doc/gui_mac.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ KEY VALUE ~
250250
*MMLoginShellCommand* which shell to use to launch Vim [string]
251251
*MMNoFontSubstitution* disable automatic font substitution [bool]
252252
*MMNoTitleBarWindow* hide title bar [bool]
253+
*MMTitlebarAppearsTransparent* enable a transparent titlebar [bool]
253254
*MMShareFindPboard* share search text to Find Pasteboard [bool]
254255
*MMShowAddTabButton* enable "add tab" button on tabline [bool]
255256
*MMTabMaxWidth* maximum width of a tab [int]

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4853,6 +4853,7 @@ MMLoginShellArgument gui_mac.txt /*MMLoginShellArgument*
48534853
MMLoginShellCommand gui_mac.txt /*MMLoginShellCommand*
48544854
MMNoFontSubstitution gui_mac.txt /*MMNoFontSubstitution*
48554855
MMNoTitleBarWindow gui_mac.txt /*MMNoTitleBarWindow*
4856+
MMTitlebarAppearsTransparent gui_mac.txt /*MMTitlebarAppearsTransparent*
48564857
MMShareFindPboard gui_mac.txt /*MMShareFindPboard*
48574858
MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton*
48584859
MMTabMaxWidth gui_mac.txt /*MMTabMaxWidth*

src/MacVim/MMWindowController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ - (id)initWithVimController:(MMVimController *)controller
148148
backing:NSBackingStoreBuffered
149149
defer:YES];
150150
[win autorelease];
151+
152+
if ([[NSUserDefaults standardUserDefaults]
153+
boolForKey:MMTitlebarAppearsTransparentKey]) {
154+
// Transparent title bar setting
155+
win.titlebarAppearsTransparent = true;
156+
}
151157

152158
self = [super initWithWindow:win];
153159
if (!self) return nil;

src/MacVim/Miscellaneous.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ extern NSString *MMTopLeftPointKey;
3434
extern NSString *MMOpenInCurrentWindowKey;
3535
extern NSString *MMNoFontSubstitutionKey;
3636
extern NSString *MMNoTitleBarWindowKey;
37+
extern NSString *MMTitlebarAppearsTransparentKey;
3738
extern NSString *MMLoginShellKey;
3839
extern NSString *MMUntitledWindowKey;
3940
extern NSString *MMZoomBothKey;

src/MacVim/Miscellaneous.m

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,43 @@
1414

1515

1616
// NSUserDefaults keys
17-
NSString *MMTabMinWidthKey = @"MMTabMinWidth";
18-
NSString *MMTabMaxWidthKey = @"MMTabMaxWidth";
19-
NSString *MMTabOptimumWidthKey = @"MMTabOptimumWidth";
20-
NSString *MMShowAddTabButtonKey = @"MMShowAddTabButton";
21-
NSString *MMTextInsetLeftKey = @"MMTextInsetLeft";
22-
NSString *MMTextInsetRightKey = @"MMTextInsetRight";
23-
NSString *MMTextInsetTopKey = @"MMTextInsetTop";
24-
NSString *MMTextInsetBottomKey = @"MMTextInsetBottom";
25-
NSString *MMTypesetterKey = @"MMTypesetter";
26-
NSString *MMCellWidthMultiplierKey = @"MMCellWidthMultiplier";
27-
NSString *MMBaselineOffsetKey = @"MMBaselineOffset";
28-
NSString *MMTranslateCtrlClickKey = @"MMTranslateCtrlClick";
29-
NSString *MMTopLeftPointKey = @"MMTopLeftPoint";
30-
NSString *MMOpenInCurrentWindowKey = @"MMOpenInCurrentWindow";
31-
NSString *MMNoFontSubstitutionKey = @"MMNoFontSubstitution";
32-
NSString *MMNoTitleBarWindowKey = @"MMNoTitleBarWindow";
33-
NSString *MMLoginShellKey = @"MMLoginShell";
34-
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
35-
NSString *MMZoomBothKey = @"MMZoomBoth";
36-
NSString *MMCurrentPreferencePaneKey = @"MMCurrentPreferencePane";
37-
NSString *MMLoginShellCommandKey = @"MMLoginShellCommand";
38-
NSString *MMLoginShellArgumentKey = @"MMLoginShellArgument";
39-
NSString *MMDialogsTrackPwdKey = @"MMDialogsTrackPwd";
40-
NSString *MMOpenLayoutKey = @"MMOpenLayout";
41-
NSString *MMVerticalSplitKey = @"MMVerticalSplit";
42-
NSString *MMPreloadCacheSizeKey = @"MMPreloadCacheSize";
43-
NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
17+
NSString *MMTabMinWidthKey = @"MMTabMinWidth";
18+
NSString *MMTabMaxWidthKey = @"MMTabMaxWidth";
19+
NSString *MMTabOptimumWidthKey = @"MMTabOptimumWidth";
20+
NSString *MMShowAddTabButtonKey = @"MMShowAddTabButton";
21+
NSString *MMTextInsetLeftKey = @"MMTextInsetLeft";
22+
NSString *MMTextInsetRightKey = @"MMTextInsetRight";
23+
NSString *MMTextInsetTopKey = @"MMTextInsetTop";
24+
NSString *MMTextInsetBottomKey = @"MMTextInsetBottom";
25+
NSString *MMTypesetterKey = @"MMTypesetter";
26+
NSString *MMCellWidthMultiplierKey = @"MMCellWidthMultiplier";
27+
NSString *MMBaselineOffsetKey = @"MMBaselineOffset";
28+
NSString *MMTranslateCtrlClickKey = @"MMTranslateCtrlClick";
29+
NSString *MMTopLeftPointKey = @"MMTopLeftPoint";
30+
NSString *MMOpenInCurrentWindowKey = @"MMOpenInCurrentWindow";
31+
NSString *MMNoFontSubstitutionKey = @"MMNoFontSubstitution";
32+
NSString *MMNoTitleBarWindowKey = @"MMNoTitleBarWindow";
33+
NSString *MMTitlebarAppearsTransparentKey = @"MMTitlebarAppearsTransparent";
34+
NSString *MMLoginShellKey = @"MMLoginShell";
35+
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
36+
NSString *MMZoomBothKey = @"MMZoomBoth";
37+
NSString *MMCurrentPreferencePaneKey = @"MMCurrentPreferencePane";
38+
NSString *MMLoginShellCommandKey = @"MMLoginShellCommand";
39+
NSString *MMLoginShellArgumentKey = @"MMLoginShellArgument";
40+
NSString *MMDialogsTrackPwdKey = @"MMDialogsTrackPwd";
41+
NSString *MMOpenLayoutKey = @"MMOpenLayout";
42+
NSString *MMVerticalSplitKey = @"MMVerticalSplit";
43+
NSString *MMPreloadCacheSizeKey = @"MMPreloadCacheSize";
44+
NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
4445
#ifdef INCLUDE_OLD_IM_CODE
45-
NSString *MMUseInlineImKey = @"MMUseInlineIm";
46+
NSString *MMUseInlineImKey = @"MMUseInlineIm";
4647
#endif // INCLUDE_OLD_IM_CODE
47-
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
48-
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
49-
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
50-
NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime";
51-
NSString *MMUseCGLayerAlwaysKey = @"MMUseCGLayerAlways";
52-
NSString *MMBufferedDrawingKey = @"MMBufferedDrawing";
48+
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
49+
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
50+
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
51+
NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime";
52+
NSString *MMUseCGLayerAlwaysKey = @"MMUseCGLayerAlways";
53+
NSString *MMBufferedDrawingKey = @"MMBufferedDrawing";
5354

5455

5556

0 commit comments

Comments
 (0)