mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: some window subclasses should not be constrained to the usable screen content
Previously, all window subclasses were constrained to the usable screen content. Unfortunately that included the menu bar window, which ended up appearing below itself! This commit introduces an ivar that indicates whether instances of the window subclass should be constrained or not.
This commit is contained in:
@@ -67,6 +67,8 @@
|
||||
|
||||
if (self)
|
||||
{
|
||||
_constrainsToUsableScreen = NO;
|
||||
|
||||
[self setLevel:CPMainMenuWindowLevel];
|
||||
[self setAutoresizingMask:CPWindowWidthSizable];
|
||||
|
||||
|
||||
@@ -87,6 +87,8 @@ _CPMenuWindowAttachedMenuBackgroundStyle = 2;
|
||||
|
||||
if (self)
|
||||
{
|
||||
_constrainsToUsableScreen = NO;
|
||||
|
||||
[self setLevel:CPPopUpMenuWindowLevel];
|
||||
[self setHasShadow:YES];
|
||||
[self setShadowStyle:CPMenuWindowShadowStyle];
|
||||
|
||||
@@ -144,6 +144,7 @@ var CPWindowActionMessageKeys = [
|
||||
BOOL _hasShadow;
|
||||
BOOL _isMovableByWindowBackground;
|
||||
BOOL _isMovable;
|
||||
BOOL _constrainsToUsableScreen;
|
||||
unsigned _shadowStyle;
|
||||
BOOL _showsResizeIndicator;
|
||||
|
||||
@@ -253,6 +254,7 @@ CPTexturedBackgroundWindowMask
|
||||
var windowViewClass = [[self class] _windowViewClassForStyleMask:aStyleMask];
|
||||
|
||||
_frame = [windowViewClass frameRectForContentRect:aContentRect];
|
||||
_constrainsToUsableScreen = YES;
|
||||
|
||||
[self _setSharesChromeWithPlatformWindow:![CPPlatform isBrowser]];
|
||||
|
||||
@@ -729,6 +731,9 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
- (CGRect)_pinFrame:(CGRect)aFrame toUsableScreenWidth:(BOOL)pinWidth andHeight:(BOOL)pinHeight
|
||||
{
|
||||
if (!_constrainsToUsableScreen)
|
||||
return CGRectMakeCopy(aFrame);
|
||||
|
||||
var usableRect = [_platformWindow usableContentFrame],
|
||||
frame = _CGRectMakeCopy(aFrame);
|
||||
|
||||
|
||||
@@ -270,6 +270,14 @@ var _CPAutocompleteMenuMaximumHeight = 307;
|
||||
|
||||
@implementation _CPAutocompleteWindow : CPPanel
|
||||
|
||||
- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned int)aStyleMask
|
||||
{
|
||||
if (self = [super initWithContentRect:aContentRect styleMask:aStyleMask])
|
||||
_constrainsToUsableScreen = NO;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)becomesKeyOnlyIfNeeded
|
||||
{
|
||||
return YES;
|
||||
|
||||
@@ -852,6 +852,14 @@ var _CPPopUpListDataSourceKey = @"_CPPopUpListDataSourceKey",
|
||||
|
||||
@implementation _CPPopUpPanel : CPPanel
|
||||
|
||||
- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned int)aStyleMask
|
||||
{
|
||||
if (self = [super initWithContentRect:aContentRect styleMask:aStyleMask])
|
||||
_constrainsToUsableScreen = NO;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)sendEvent:(CPEvent)anEvent
|
||||
{
|
||||
var type = [anEvent type];
|
||||
|
||||
@@ -167,6 +167,8 @@ var _CPToolTipHeight = 24.0,
|
||||
|
||||
if (self = [super initWithContentRect:toolTipFrame styleMask:aStyleMask])
|
||||
{
|
||||
_constrainsToUsableScreen = NO;
|
||||
|
||||
textFrameSize.height += 4;
|
||||
|
||||
_content = [CPTextField labelWithTitle:aString];
|
||||
|
||||
Reference in New Issue
Block a user