Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions src/MacVim/Base.lproj/Preferences.xib
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@
<point key="canvasLocation" x="137.5" y="21.5"/>
</customView>
<customView id="hr4-G4-3ZG" userLabel="Appearance">
<rect key="frame" x="0.0" y="0.0" width="483" height="341"/>
<rect key="frame" x="0.0" y="0.0" width="483" height="360"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView id="fw0-VK-Nbz" userLabel="Dark mode selection">
<rect key="frame" x="19" y="163" width="433" height="156"/>
<rect key="frame" x="19" y="182" width="433" height="156"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="T40-Os-PUf" userLabel="Dark mode selection">
Expand Down Expand Up @@ -322,13 +322,22 @@
</subviews>
</customView>
<customView id="7af-iK-4r7" userLabel="Titlebar appearance">
<rect key="frame" x="19" y="117" width="433" height="38"/>
<rect key="frame" x="19" y="118" width="433" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="9Rk-gT-kVC" userLabel="Titlebar appearance">
<rect key="frame" x="-2" y="38" width="187" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Window appearance:" id="HEH-Lo-v4I" userLabel="Titlebar appearance:">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="7ie-0J-0Zr">
<rect key="frame" x="189" y="19" width="244" height="18"/>
<rect key="frame" x="189" y="37" width="244" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Transparent" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="hzd-hj-Pth">
<buttonCell key="cell" type="check" title="Transparent title bar" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="hzd-hj-Pth">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand All @@ -337,19 +346,10 @@
<binding destination="58" name="value" keyPath="values.MMTitlebarAppearsTransparent" id="pQP-eb-JXS"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="9Rk-gT-kVC" userLabel="Titlebar appearance">
<rect key="frame" x="-2" y="20" width="187" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Titlebar appearance:" id="HEH-Lo-v4I" userLabel="Titlebar appearance:">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="Hqh-Ql-2od">
<rect key="frame" x="189" y="1" width="244" height="18"/>
<rect key="frame" x="189" y="19" width="244" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Hidden" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="W40-cB-m1U">
<buttonCell key="cell" type="check" title="Hidden title bar" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="W40-cB-m1U">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand All @@ -358,10 +358,22 @@
<binding destination="58" name="value" keyPath="values.MMNoTitleBarWindow" id="CKL-mo-ZhZ"/>
</connections>
</button>
<button id="s2M-pj-U8e">
<rect key="frame" x="189" y="1" width="244" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="No drop shadows" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="VM8-tg-mVV">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="appearanceChanged:" target="-2" id="NXD-lz-QZf"/>
<binding destination="58" name="value" keyPath="values.MMNoWindowShadow" id="VXH-pD-vgT"/>
</connections>
</button>
</subviews>
</customView>
<customView id="BpJ-rH-ona" userLabel="Full Screen">
<rect key="frame" x="19" y="71" width="433" height="38"/>
<rect key="frame" x="19" y="72" width="433" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button toolTip="Use macOS's native full screen mode, which integrates with Mission Control and creates a new Space for the window." id="YKV-u2-Egc" userLabel="Use native full screen">
Expand Down Expand Up @@ -433,7 +445,7 @@
</subviews>
</customView>
<customView id="Dey-Wx-2gx" userLabel="Cmdline">
<rect key="frame" x="20" y="20" width="433" height="18"/>
<rect key="frame" x="19" y="20" width="433" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="qMh-iV-0iD">
Expand Down Expand Up @@ -461,7 +473,7 @@
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="137.5" y="425.5"/>
<point key="canvasLocation" x="137.5" y="435"/>
</customView>
<customView id="620" userLabel="Advanced">
<rect key="frame" x="0.0" y="0.0" width="483" height="264"/>
Expand Down
1 change: 1 addition & 0 deletions src/MacVim/MMAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ + (void)initialize
MMRendererKey,
[NSNumber numberWithInt:MMUntitledWindowAlways],
MMUntitledWindowKey,
[NSNumber numberWithBool:NO], MMNoWindowShadowKey,
[NSNumber numberWithBool:NO], MMZoomBothKey,
@"", MMLoginShellCommandKey,
@"", MMLoginShellArgumentKey,
Expand Down
20 changes: 13 additions & 7 deletions src/MacVim/MMWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ - (id)initWithVimController:(MMVimController *)controller
| NSWindowStyleMaskUnifiedTitleAndToolbar
| NSWindowStyleMaskTexturedBackground;

if ([[NSUserDefaults standardUserDefaults]
boolForKey:MMNoTitleBarWindowKey]) {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults boolForKey:MMNoTitleBarWindowKey]) {
// No title bar setting
styleMask &= ~NSWindowStyleMaskTitled;
}
Expand Down Expand Up @@ -571,23 +571,29 @@ - (void)refreshApperanceMode
// This function calculates what apperance mode (light vs dark mode and
// titlebar settings) to use for this window, depending on what the user
// has selected as a preference.
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];

// Transparent title bar setting
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
if (@available(macos 10.10, *)) {
decoratedWindow.titlebarAppearsTransparent = [[NSUserDefaults standardUserDefaults]
boolForKey:MMTitlebarAppearsTransparentKey];
decoratedWindow.titlebarAppearsTransparent = [ud boolForKey:MMTitlebarAppearsTransparentKey];
}
#endif

// No title bar setting
if ([[NSUserDefaults standardUserDefaults]
boolForKey:MMNoTitleBarWindowKey]) {
if ([ud boolForKey:MMNoTitleBarWindowKey]) {
[decoratedWindow setStyleMask:([decoratedWindow styleMask] & ~NSWindowStyleMaskTitled)];
} else {
[decoratedWindow setStyleMask:([decoratedWindow styleMask] | NSWindowStyleMaskTitled)];
}

// Whether to hide shadows or not
if ([ud boolForKey:MMNoWindowShadowKey]) {
[decoratedWindow setHasShadow:NO];
} else {
[decoratedWindow setHasShadow:YES];
}

// Title may have been lost if we hid the title-bar. Reset it.
[self setTitle:lastSetTitle];

Expand All @@ -596,7 +602,7 @@ - (void)refreshApperanceMode
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
if (@available(macos 10.14, *)) {
NSAppearance* desiredAppearance;
switch ([[NSUserDefaults standardUserDefaults] integerForKey:MMAppearanceModeSelectionKey])
switch ([ud integerForKey:MMAppearanceModeSelectionKey])
{
case MMAppearanceModeSelectionLight:
{
Expand Down
1 change: 1 addition & 0 deletions src/MacVim/Miscellaneous.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern NSString *MMFontPreserveLineSpacingKey;
extern NSString *MMAppearanceModeSelectionKey;
extern NSString *MMNoTitleBarWindowKey;
extern NSString *MMTitlebarAppearsTransparentKey;
extern NSString *MMNoWindowShadowKey;
extern NSString *MMDisableLaunchAnimation;
extern NSString *MMLoginShellKey;
extern NSString *MMUntitledWindowKey;
Expand Down
1 change: 1 addition & 0 deletions src/MacVim/Miscellaneous.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
NSString *MMAppearanceModeSelectionKey = @"MMAppearanceModeSelection";
NSString *MMNoTitleBarWindowKey = @"MMNoTitleBarWindow";
NSString *MMTitlebarAppearsTransparentKey = @"MMTitlebarAppearsTransparent";
NSString *MMNoWindowShadowKey = @"MMNoWindowShadow";
NSString *MMDisableLaunchAnimation = @"MMDisableLaunchAnimation";
NSString *MMLoginShellKey = @"MMLoginShell";
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
Expand Down