mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Fixed: window content view overlapped window frame
Previously, the content view of almost all window types
could overlap the frame of the window.
This is a follow on to b28429f which insets the content view
from the frame for all relevant window types.
Refs #1798
This commit is contained in:
1 parent
cbe8659cc7
commit
887421c9fa
5 files changed
+32
-5
No files matched your search
@@ -394,7 +394,7 @@ CPTexturedBackgroundWindowMask
|
||||
return _CPDocModalWindowView;
|
||||
|
||||
else if (aStyleMask & _CPModalWindowMask)
|
||||
return _CPModalWindowView
|
||||
return _CPModalWindowView;
|
||||
|
||||
return _CPStandardWindowView;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,17 @@
|
||||
};
|
||||
}
|
||||
|
||||
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
/*
|
||||
This window view class draws a frame.
|
||||
So we have to inset the content rect to be inside the frame.
|
||||
*/
|
||||
var contentRect = [super contentRectForFrameRect:aFrameRect];
|
||||
|
||||
return _CGRectInset(contentRect, 1.0, 1.0);
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame styleMask:(unsigned)aStyleMask
|
||||
{
|
||||
self = [super initWithFrame:aFrame styleMask:aStyleMask];
|
||||
@@ -67,12 +78,12 @@
|
||||
|
||||
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
return aFrameRect;
|
||||
return [[self class] contentRectForFrameRect:aFrameRect];
|
||||
}
|
||||
|
||||
- (CGRect)frameRectForContentRect:(CGRect)aContentRect
|
||||
{
|
||||
return aContentRect;
|
||||
return [[self class] frameRectForContentRect:aContentRect];
|
||||
}
|
||||
|
||||
- (void)_enableSheet:(BOOL)enable
|
||||
|
||||
@@ -36,6 +36,22 @@
|
||||
return @"hud-window-view";
|
||||
}
|
||||
|
||||
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
/*
|
||||
This window view class draws a frame.
|
||||
So we have to inset the content rect to be inside the frame.
|
||||
The top coordinate has already been adjusted by _CPTitleableWindowView.
|
||||
*/
|
||||
var contentRect = [super contentRectForFrameRect:aFrameRect];
|
||||
|
||||
contentRect.origin.x += 1;
|
||||
contentRect.size.width -= 2;
|
||||
contentRect.size.height -= 1;
|
||||
|
||||
return contentRect;
|
||||
}
|
||||
|
||||
- (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
var contentRect = [[self class] contentRectForFrameRect:aFrameRect];
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
var contentRect = CGRectMakeCopy(aFrameRect),
|
||||
var contentRect = [super contentRectForFrameRect:aFrameRect],
|
||||
titleBarHeight = [self titleBarHeight];
|
||||
|
||||
contentRect.origin.y += titleBarHeight;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
*/
|
||||
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
var contentRect = CGRectMakeCopy(aFrameRect);
|
||||
var contentRect = [super contentRectForFrameRect:aFrameRect];
|
||||
|
||||
contentRect.origin.x += 3;
|
||||
contentRect.origin.y += 3;
|
||||
|
||||
Reference in new issue
Block a user