Skip to content
Browse files

ShiftIt v2.2

  • Loading branch information...
1 parent ee2e67a commit d8fcaba9855f7a8496628fab31bfda2816d7260d Onsi Fakhouri committed
View
6 .gitignore
@@ -1,6 +1,6 @@
ShiftIt/build
-release-notes-*
-ShiftIt-*.zip
ShiftIt/ShiftIt.xcodeproj/*.pbxuser
ShiftIt/ShiftIt.xcodeproj/*.perspectivev3
-*.mode1v3
+ShiftIt/DerivedData
+*.mode1v3
+.DS_Store
View
21 README.md
@@ -12,8 +12,7 @@ License: [GNU General Public License v3](http://www.gnu.org/licenses/gpl.html) (
## Using ShiftIt
-To install: grab the binary from the [downloads section](https://github.com/onsi/ShiftIt/downloads).
-I've tested ShiftIt on Lion but will make sure all is well with Mountain Lion when I upgrade.
+To install: download and unzip [ShiftIt.zip](https://raw.github.com/onsi/ShiftIt/master/ShiftIt.zip).
ShiftIt allows you to tile windows using your keyboard:
@@ -30,17 +29,12 @@ So, to throw a window to the top-left corner: ⌃⌥⌘ + ←, ⌃⌥⌘ + ↑,
**Also Note** some applications enforce specific size restrictions. As far as I can tell there is no way to measure these restrictions *before* resizing windows. In particular: Xcode doesn't like to get too small, so ShiftIt can't toggle Xcode through thirds on small monitors. Also, Terminal quantizes its sizes to integer rows and columns, so ShiftIt's manipulations of terminal are approximate and there is sometimes a little overlap/gap around the edges.
-## Compiling
-
-On Lion you should be able to open up the Xcode project and compile it.
-
-## 3rd Party Frameworks
-
- * [ShortcutRecorder](http://code.google.com/p/shortcutrecorder/) framework (*New BSD license*) for capturing key bindings during hotkey reconfiguration.
- * [FMT](https://github.com/fikovnik/FMT) framework (*MIT license*) for some utility functions like handling login items, hot keys, etc.
-
## Release Notes
+- v2.2 (6/14/2013)
+ - Fixed bug in multi-monitor support where two monitors are mirrored and one monitor is not.
+ - Tool bar icon is now retina-friendly
+
- v2.1 (8/16/2012)
- Fixed embarrasing multi-monitor bug
@@ -49,3 +43,8 @@ On Lion you should be able to open up the Xcode project and compile it.
- More robust window sizing
- General code clean up
- Rewrite of window tiling code
+
+## 3rd Party Frameworks
+
+ * [ShortcutRecorder](http://code.google.com/p/shortcutrecorder/) framework (*New BSD license*) for capturing key bindings during hotkey reconfiguration.
+ * [FMT](https://github.com/fikovnik/FMT) framework (*MIT license*) for some utility functions like handling login items, hot keys, etc.
View
BIN ShiftIt.zip
Binary file not shown.
View
22 ShiftIt/ShiftComputer.m
@@ -153,11 +153,29 @@ - (void)center {
to:CGPointCenterOfCGRect(frame)];
}
+- (NSString *)frameKeyForScreen:(NSScreen *)screen
+
+{
+ return [NSString stringWithFormat:@"%.1f,%.1f,%.1f,%.1f", screen.frame.origin.x, screen.frame.origin.y, screen.frame.size.width, screen.frame.size.height];
+}
+
+
+
- (void)swapscreen {
if ([[NSScreen screens] count] > 1) {
+ NSMutableArray *uniqueScreens = [NSMutableArray array];
+ NSMutableDictionary *screenFrameLookup = [NSMutableDictionary dictionary];
+ for (NSScreen *screen in [NSScreen screens]) {
+ NSString *frameKey = [self frameKeyForScreen:screen];
+ if (!screenFrameLookup[frameKey]) {
+ [uniqueScreens addObject:screen];
+ screenFrameLookup[frameKey] = screen;
+ }
+ }
+
NSScreen *currentScreen = self.window.screen;
- NSUInteger index = [[NSScreen screens] indexOfObject:currentScreen] + 1;
- NSScreen *nextScreen = [[NSScreen screens] objectAtIndex:index % [[NSScreen screens] count]];
+ NSUInteger index = [uniqueScreens indexOfObject:screenFrameLookup[[self frameKeyForScreen:currentScreen]]] + 1;
+ NSScreen *nextScreen = [uniqueScreens objectAtIndex:index % uniqueScreens.count];
CGRect frame = [nextScreen windowRectFromScreenRect:nextScreen.visibleFrame];
[self.window setWindowSize:CGSizeMake(frame.size.width * 0.85, frame.size.height * 0.85)
View
2 ShiftIt/ShiftIt-Info.plist
@@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>2.1</string>
+ <string>2.2</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
View
BIN ShiftIt/ShiftIt-menuIcon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN ShiftIt/ShiftIt-menuIcon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN ShiftIt/ShiftIt.icns
Binary file not shown.
View
12 ShiftIt/ShiftIt.xcodeproj/project.pbxproj
@@ -19,11 +19,12 @@
27F4FD4D12730F2F00A65750 /* FMTHotKeyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F4FD4A12730F2F00A65750 /* FMTHotKeyManager.m */; };
27F4FD5612730F4600A65750 /* FMTLoginItems.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F4FD5312730F4600A65750 /* FMTLoginItems.m */; };
27F4FD5712730F4600A65750 /* FMTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F4FD5512730F4600A65750 /* FMTUtils.m */; };
- 83E55ED5125A5FCF00FC49BF /* ShiftIt-menuIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon.png */; };
+ 83E55ED5125A5FCF00FC49BF /* ShiftIt-menuIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon@2x.png */; };
83E55ED6125A5FCF00FC49BF /* ShiftIt.icns in Resources */ = {isa = PBXBuildFile; fileRef = 83E55ED4125A5FCF00FC49BF /* ShiftIt.icns */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ E32D97F017935BAD0098A52C /* ShiftIt-menuIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = E32D97EF17935BAD0098A52C /* ShiftIt-menuIcon.png */; };
E3478FD515CF466300BA1A16 /* ShiftableWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E3478FD415CF466300BA1A16 /* ShiftableWindow.m */; };
E3478FD715CF47E000BA1A16 /* ShiftIt.m in Sources */ = {isa = PBXBuildFile; fileRef = E3478FD615CF47E000BA1A16 /* ShiftIt.m */; };
E3F68AE415CD90D300CD3A90 /* NSScreen+Coordinates.m in Sources */ = {isa = PBXBuildFile; fileRef = E3F68AE315CD90D300CD3A90 /* NSScreen+Coordinates.m */; };
@@ -72,10 +73,11 @@
27F4FD5512730F4600A65750 /* FMTUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FMTUtils.m; path = FMT/FMTUtils.m; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
- 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ShiftIt-menuIcon.png"; sourceTree = "<group>"; };
+ 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ShiftIt-menuIcon@2x.png"; sourceTree = "<group>"; };
83E55ED4125A5FCF00FC49BF /* ShiftIt.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ShiftIt.icns; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* ShiftIt-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ShiftIt-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* ShiftIt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShiftIt.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ E32D97EF17935BAD0098A52C /* ShiftIt-menuIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ShiftIt-menuIcon.png"; sourceTree = "<group>"; };
E3478FD315CF466300BA1A16 /* ShiftableWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShiftableWindow.h; sourceTree = "<group>"; };
E3478FD415CF466300BA1A16 /* ShiftableWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShiftableWindow.m; sourceTree = "<group>"; };
E3478FD615CF47E000BA1A16 /* ShiftIt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShiftIt.m; sourceTree = "<group>"; };
@@ -207,7 +209,8 @@
isa = PBXGroup;
children = (
27A14EBF1269EC1500E68263 /* ShiftIt-defaults.plist */,
- 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon.png */,
+ E32D97EF17935BAD0098A52C /* ShiftIt-menuIcon.png */,
+ 83E55ED3125A5FCF00FC49BF /* ShiftIt-menuIcon@2x.png */,
83E55ED4125A5FCF00FC49BF /* ShiftIt.icns */,
8D1107310486CEB800E47090 /* ShiftIt-Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
@@ -289,9 +292,10 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
F2DC1A321133829D009BDCA5 /* PreferencesWindow.xib in Resources */,
- 83E55ED5125A5FCF00FC49BF /* ShiftIt-menuIcon.png in Resources */,
+ 83E55ED5125A5FCF00FC49BF /* ShiftIt-menuIcon@2x.png in Resources */,
83E55ED6125A5FCF00FC49BF /* ShiftIt.icns in Resources */,
27A14EC01269EC1500E68263 /* ShiftIt-defaults.plist in Resources */,
+ E32D97F017935BAD0098A52C /* ShiftIt-menuIcon.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN ....xcodeproj/project.xcworkspace/xcuserdata/onsi.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
3 ShiftIt/ShiftItAppDelegate.m
@@ -72,8 +72,7 @@ - (id)init{
return nil;
}
- NSString *iconPath = FMTGetMainBundleResourcePath(kSIIconName, @"png");
- statusMenuItemIcon_ = [[NSImage alloc] initWithContentsOfFile:iconPath];
+ statusMenuItemIcon_ = [[NSImage imageNamed:kSIIconName] retain];
allHotKeys_ = [[NSMutableDictionary alloc] init];
return self;

0 comments on commit d8fcaba

Please sign in to comment.
Something went wrong with that request. Please try again.