origin isn't going to always be zero.
Added a setScreen and overrode -screen to the status window class.
- (void)setScale:(float)scale angle:(float)angle
{
- int hPos = [_window horizontalPosition];
+ //int hPos = [_window horizontalPosition];
float radAngle = (angle * 4 * pi);
CGAffineTransform transform;
NSPoint translation;
NSRect screenFrame = [[_window screen] frame];
- translation.x = screenFrame.origin.x + ([_window frame].size.width / 2.0);
- translation.y = screenFrame.origin.y + ([_window frame].size.height / 2.0);
+ translation.x = /*screenFrame.origin.x + */([_window frame].size.width / 2.0);
+ translation.y = /*screenFrame.origin.y + */([_window frame].size.height / 2.0);
transform = CGAffineTransformMakeTranslation(translation.x, translation.y);
transform = CGAffineTransformScale(transform, 1.0 / scale, 1.0 / scale);
transform = CGAffineTransformRotate(transform, radAngle);
transform = CGAffineTransformTranslate(transform, -translation.x, -translation.y);
- if (hPos == ITWindowPositionLeft) {
+ /*if (hPos == ITWindowPositionLeft) {
translation.x = -[_window frame].origin.x;
} else if (hPos == ITWindowPositionRight) {
translation.x = -[_window frame].origin.x;
} else {
translation.x = -[_window frame].origin.x;
- }
-
- translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height );
+ }*/
+ translation.x = -[_window frame].origin.x;
+ translation.y = -( screenFrame.size.height - [_window frame].origin.y - [_window frame].size.height );
transform = CGAffineTransformTranslate(transform, translation.x, translation.y);
CGSSetWindowTransform([NSApp contextID],
- (void)setSpin:(float)progress
{
- int hPos = [_window horizontalPosition];
+ //int hPos = [_window horizontalPosition];
float radAngle = (progress * 4 * pi);
CGAffineTransform transform;
NSPoint translation;
NSRect screenFrame = [[_window screen] frame];
- translation.x = screenFrame.origin.x + ([_window frame].size.width / 2.0);
- translation.y = screenFrame.origin.y + ([_window frame].size.height / 2.0);
+ translation.x = /*screenFrame.origin.x + */([_window frame].size.width / 2.0);
+ translation.y = /*screenFrame.origin.y + */([_window frame].size.height / 2.0);
transform = CGAffineTransformMakeTranslation(translation.x, translation.y);
transform = CGAffineTransformRotate(transform, radAngle);
transform = CGAffineTransformTranslate(transform, -translation.x, -translation.y);
- if (hPos == ITWindowPositionLeft) {
+ /*if (hPos == ITWindowPositionLeft) {
translation.x = -[_window frame].origin.x;
} else if (hPos == ITWindowPositionRight) {
translation.x = -[_window frame].origin.x;
} else {
translation.x = -[_window frame].origin.x;
- }
-
- translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height );
+ }*/
+ translation.x = -[_window frame].origin.x;
+ translation.y = -( screenFrame.size.height - [_window frame].origin.y - [_window frame].size.height );
transform = CGAffineTransformTranslate(transform, translation.x, translation.y);
CGSSetWindowTransform([NSApp contextID],
ITTransientStatusWindowSizing _sizing;
float _screenPadding;
// int _screenNumber;
+ NSScreen *_screen;
BOOL _reallyIgnoresEvents;
- (void)appear:(id)sender;
- (void)vanish:(id)sender;
+- (void)setScreen:(NSScreen *)newScreen;
+
- (void)setSizing:(ITTransientStatusWindowSizing)newSizing;
- (ITTransientStatusWindowSizing)sizing;
_exitEffect = nil;
_reallyIgnoresEvents = YES;
_exitTimer = nil;
+ [self setScreen:[NSScreen mainScreen]];
// if ( _backgroundType == ITTransientStatusWindowRounded ) {
// _contentSubView = contentView;
return self;
}
+- (void)dealloc
+{
+ [_screen release];
+ [super dealloc];
+}
/*************************************************************************/
#pragma mark -
}
}
+- (void)setScreen:(NSScreen *)newScreen
+{
+ [_screen release];
+ _screen = [newScreen retain];
+}
+
+- (NSScreen *)screen
+{
+ return _screen;
+}
+
- (void)setSizing:(ITTransientStatusWindowSizing)newSizing
{
_sizing = newSizing;
- (void)performAppear
{
__idle = NO;
-
+
[self setWindowVisibility:ITWindowAppearingState];
[self performAppearFromProgress:0.0 effectTime:_effectTime];
}
- (void)setZoom:(float)Zoom
{
- int hPos = [_window horizontalPosition];
+ //int hPos = [_window horizontalPosition];
CGAffineTransform transform;
NSPoint translation;
NSRect screenFrame = [[_window screen] frame];
- translation.x = screenFrame.origin.x + ([_window frame].size.width / 2.0);
- translation.y = screenFrame.origin.y + ([_window frame].size.height / 2.0);
+ translation.x = /*screenFrame.origin.x + */([_window frame].size.width / 2.0);
+ translation.y = /*screenFrame.origin.y + */([_window frame].size.height / 2.0);
transform = CGAffineTransformMakeTranslation(translation.x, translation.y);
transform = CGAffineTransformScale(transform, 1.0 / Zoom, 1.0 / Zoom);
transform = CGAffineTransformTranslate(transform, -translation.x, -translation.y);
- if (hPos == ITWindowPositionLeft) {
+ /*if (hPos == ITWindowPositionLeft) {
translation.x = -[_window frame].origin.x;
} else if (hPos == ITWindowPositionRight) {
translation.x = -[_window frame].origin.x;
} else {
translation.x = -[_window frame].origin.x;
- }
-
- translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height );
+ }*/
+ translation.x = -[_window frame].origin.x;
+ translation.y = -( screenFrame.size.height - [_window frame].origin.y - [_window frame].size.height );
transform = CGAffineTransformTranslate(transform, translation.x, translation.y);