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:
Bjorn Winckler
2008-02-16 19:55:44 +01:00
parent 9265b87738
commit 17b0feb45b
5 changed files with 16 additions and 7 deletions
+1
View File
@@ -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
+1
View File
@@ -115,6 +115,7 @@ typedef struct
[NSNumber numberWithInt:MMUntitledWindowAlways],
MMUntitledWindowKey,
[NSNumber numberWithBool:NO], MMTexturedWindowKey,
[NSNumber numberWithBool:NO], MMZoomBothKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
+12 -7
View File
@@ -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;
}
+1
View File
@@ -220,6 +220,7 @@ extern NSString *MMLoginShellKey;
extern NSString *MMAtsuiRendererKey;
extern NSString *MMUntitledWindowKey;
extern NSString *MMTexturedWindowKey;
extern NSString *MMZoomBothKey;
// Enum for MMUntitledWindowKey
enum {
+1
View File
@@ -100,6 +100,7 @@ NSString *MMLoginShellKey = @"MMLoginShell";
NSString *MMAtsuiRendererKey = @"MMAtsuiRenderer";
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
NSString *MMTexturedWindowKey = @"MMTexturedWindow";
NSString *MMZoomBothKey = @"MMZoomBoth";