mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-03 17:30:42 +00:00
* Source/NSWindow.m: Change to correct issue with NSWindow placement
when toolbar is present. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26476 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
79e8f4f0fd
commit
a92da16be5
2 changed files with 48 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-04-27 18:42-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Source/NSWindow.m: Change to correct issue with NSWindow placement
|
||||||
|
when toolbar is present.
|
||||||
|
|
||||||
2008-04-25 18:16-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
2008-04-25 18:16-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/GSNibTemplates.m: Correct [GSNibTemplates deferredWindows] to
|
* Source/GSNibTemplates.m: Correct [GSNibTemplates deferredWindows] to
|
||||||
|
|
|
@ -106,6 +106,24 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
||||||
- (void) _viewWillMoveToWindow: (NSWindow*)newWindow;
|
- (void) _viewWillMoveToWindow: (NSWindow*)newWindow;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSScreen (PrivateMethods)
|
||||||
|
- (id) _initWithScreenNumber: (int)screen;
|
||||||
|
@end
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: Not sure if I should be exposing this here, but it seems to be the only way
|
||||||
|
* to fix the window frame save issue when a toolbar is present.
|
||||||
|
*/
|
||||||
|
@interface NSWindow (ToolbarPrivate)
|
||||||
|
- (id) toolbar;
|
||||||
|
- (NSView *)contentViewWithoutToolbar;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface NSToolbar (GNUstepPrivate)
|
||||||
|
- (GSToolbarView *) _toolbarView;
|
||||||
|
@end
|
||||||
|
// FIXME: END (GJC)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Category for internal methods (for use only within the NSWindow class itself
|
* Category for internal methods (for use only within the NSWindow class itself
|
||||||
* or with other AppKit classes.
|
* or with other AppKit classes.
|
||||||
|
@ -1001,8 +1019,9 @@ many times.
|
||||||
// Get the properties for the underlying window
|
// Get the properties for the underlying window
|
||||||
winNum = [srv nativeWindow: windowRef : &contentRect : &bufferingType
|
winNum = [srv nativeWindow: windowRef : &contentRect : &bufferingType
|
||||||
: &aStyle : &screen];
|
: &aStyle : &screen];
|
||||||
// FIXME: Get the screen for the right screen number.
|
|
||||||
aScreen = nil;
|
// Get the screen for the right screen number.
|
||||||
|
aScreen = [[NSScreen alloc] _initWithScreenNumber: screen];
|
||||||
|
|
||||||
// Set up a NSWindow with the same properties
|
// Set up a NSWindow with the same properties
|
||||||
self = [self initWithContentRect: contentRect
|
self = [self initWithContentRect: contentRect
|
||||||
|
@ -1041,13 +1060,11 @@ many times.
|
||||||
|
|
||||||
- (NSRect) contentRectForFrameRect: (NSRect)frameRect
|
- (NSRect) contentRectForFrameRect: (NSRect)frameRect
|
||||||
{
|
{
|
||||||
// FIXME
|
|
||||||
return [isa contentRectForFrameRect: frameRect styleMask: _styleMask];
|
return [isa contentRectForFrameRect: frameRect styleMask: _styleMask];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRect) frameRectForContentRect: (NSRect)contentRect
|
- (NSRect) frameRectForContentRect: (NSRect)contentRect
|
||||||
{
|
{
|
||||||
// FIXME
|
|
||||||
return [isa frameRectForContentRect: contentRect styleMask: _styleMask];
|
return [isa frameRectForContentRect: contentRect styleMask: _styleMask];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4478,6 +4495,28 @@ current key view.<br />
|
||||||
|
|
||||||
fRect = _frame;
|
fRect = _frame;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: This may not be such an elegant solution, but it works.
|
||||||
|
* I need to find a better way to handle this, maybe in the window
|
||||||
|
* decoration view could handle these calculations.
|
||||||
|
*/
|
||||||
|
if([self toolbar] != nil)
|
||||||
|
{
|
||||||
|
NSView *tbview = [[self toolbar] _toolbarView];
|
||||||
|
NSRect tbframe = [tbview frame];
|
||||||
|
if([tbview superview] != nil)
|
||||||
|
{
|
||||||
|
NSRect r = [[self contentViewWithoutToolbar] frame];
|
||||||
|
r = [NSWindow frameRectForContentRect: r
|
||||||
|
styleMask: _styleMask];
|
||||||
|
|
||||||
|
// copy w/h
|
||||||
|
fRect.size.width = r.size.width;
|
||||||
|
fRect.size.height = r.size.height;
|
||||||
|
fRect.origin.y += tbframe.size.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The screen rectangle should gives the area of the screen in which
|
* The screen rectangle should gives the area of the screen in which
|
||||||
* the window could be placed (ie a rectangle excluding the dock).
|
* the window could be placed (ie a rectangle excluding the dock).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue