mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Add MMZoomBoth user default
If MMZoomBoth user default is enabled, then the green zoom button will maximize horizontally as well as vertically.
This commit is contained in:
@@ -230,6 +230,7 @@ MMTextInsetRight text area offset in pixels [int]
|
||||
MMTextInsetTop text area offset in pixels [int]
|
||||
MMTexturedWindow use brushed metal window (Tiger only) [bool]
|
||||
MMTranslateCtrlClick interpret ctrl-click as right-click [bool]
|
||||
MMZoomBoth zoom button maximizes both directions [bool]
|
||||
|
||||
As an example, if you have more than one mouse button and would wish to free
|
||||
up Ctrl-click so you can bind it to something else, then the appropriate
|
||||
|
||||
@@ -115,6 +115,7 @@ typedef struct
|
||||
[NSNumber numberWithInt:MMUntitledWindowAlways],
|
||||
MMUntitledWindowKey,
|
||||
[NSNumber numberWithBool:NO], MMTexturedWindowKey,
|
||||
[NSNumber numberWithBool:NO], MMZoomBothKey,
|
||||
nil];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
|
||||
@@ -683,14 +683,19 @@
|
||||
defaultFrame:(NSRect)frame
|
||||
{
|
||||
// Keep old width and horizontal position unless user clicked while the
|
||||
// Command key is held down.
|
||||
// Command key is held down, or if the MMZoomBoth user default is set.
|
||||
|
||||
NSEvent *event = [NSApp currentEvent];
|
||||
if (!([event type] == NSLeftMouseUp
|
||||
&& [event modifierFlags] & NSCommandKeyMask)) {
|
||||
NSRect currentFrame = [win frame];
|
||||
frame.size.width = currentFrame.size.width;
|
||||
frame.origin.x = currentFrame.origin.x;
|
||||
}
|
||||
BOOL cmdLeftClick = [event type] == NSLeftMouseUp
|
||||
&& [event modifierFlags] & NSCommandKeyMask;
|
||||
BOOL zoomBoth = [[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMZoomBothKey];
|
||||
if (zoomBoth || cmdLeftClick)
|
||||
return frame;
|
||||
|
||||
NSRect currentFrame = [win frame];
|
||||
frame.size.width = currentFrame.size.width;
|
||||
frame.origin.x = currentFrame.origin.x;
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
@@ -220,6 +220,7 @@ extern NSString *MMLoginShellKey;
|
||||
extern NSString *MMAtsuiRendererKey;
|
||||
extern NSString *MMUntitledWindowKey;
|
||||
extern NSString *MMTexturedWindowKey;
|
||||
extern NSString *MMZoomBothKey;
|
||||
|
||||
// Enum for MMUntitledWindowKey
|
||||
enum {
|
||||
|
||||
@@ -100,6 +100,7 @@ NSString *MMLoginShellKey = @"MMLoginShell";
|
||||
NSString *MMAtsuiRendererKey = @"MMAtsuiRenderer";
|
||||
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
|
||||
NSString *MMTexturedWindowKey = @"MMTexturedWindow";
|
||||
NSString *MMZoomBothKey = @"MMZoomBoth";
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user