Fix for borderless bridge windows showing and allowing the user to use resize indicator.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I
2009-11-14 14:41:09 -08:00
parent 5fc67ff7de
commit 312a48a3fe
3 changed files with 20 additions and 7 deletions
+13 -3
View File
@@ -257,6 +257,7 @@ var CPWindowSaveImage = nil,
BOOL _hasShadow;
BOOL _isMovableByWindowBackground;
unsigned _shadowStyle;
BOOL _showsResizeIndicator;
BOOL _isDocumentEdited;
BOOL _isDocumentSaving;
@@ -421,6 +422,8 @@ CPTexturedBackgroundWindowMask
_defaultButtonEnabled = YES;
_keyViewLoopIsDirty = YES;
[self setShowsResizeIndicator:_styleMask & CPResizableWindowMask];
}
return self;
@@ -501,6 +504,7 @@ CPTexturedBackgroundWindowMask
[_windowView addSubview:_contentView];
[_windowView setTitle:_title];
[_windowView noteToolbarChanged];
[_windowView setShowsResizeIndicator:[self showsResizeIndicator]];
[self setFrame:[self frameRectForContentRect:contentRect]];
}
@@ -794,7 +798,7 @@ CPTexturedBackgroundWindowMask
*/
- (BOOL)showsResizeIndicator
{
return [_windowView showsResizeIndicator];
return _showsResizeIndicator;
}
/*!
@@ -802,8 +806,14 @@ CPTexturedBackgroundWindowMask
@param shouldShowResizeIndicator \c YES sets the window to show its resize indicator.
*/
- (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator
{
[_windowView setShowsResizeIndicator:shouldShowResizeIndicator];
{
shouldShowResizeIndicator = !!shouldShowResizeIndicator;
if (_showsResizeIndicator === shouldShowResizeIndicator)
return;
_showsResizeIndicator = shouldShowResizeIndicator;
[_windowView setShowsResizeIndicator:[self showsResizeIndicator]];
}
/*!
@@ -38,6 +38,11 @@ var _CPToolbarViewBackgroundColor = nil;
return _CPToolbarViewBackgroundColor;
}
- (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator
{
// We don't ever want to show the resize indicator.
}
- (void)tile
{
[super tile];
+2 -4
View File
@@ -81,8 +81,6 @@ var _CPWindowViewResizeIndicatorImage = nil;
_styleMask = aStyleMask;
_resizeIndicatorOffset = CGSizeMake(0.0, 0.0);
_toolbarOffset = CGSizeMake(0.0, 0.0);
[self setShowsResizeIndicator:!(_styleMask & CPBorderlessBridgeWindowMask) && (_styleMask & CPResizableWindowMask)];
}
return self;
@@ -213,13 +211,13 @@ var _CPWindowViewResizeIndicatorImage = nil;
[_resizeIndicator setImage:_CPWindowViewResizeIndicatorImage];
[_resizeIndicator setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin];
[self addSubview:_resizeIndicator];
}
else
{
[_resizeIndicator removeFromSuperview];
_resizeIndicator = nil;
}
}