mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
Improve last but one commit by not including an in-window menu in a
window's saved frame as well. Also avoid a redundant cast from float to int and back. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31941 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6eaff61772
commit
1a887c7645
2 changed files with 21 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-01-24 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSWindow.m (-setFrameFromString:, -stringWithSavedFrame):
|
||||||
|
Do not include an in-window menu in a window's saved frame either.
|
||||||
|
|
||||||
2011-01-24 Fred Kiefer <FredKiefer@gmx.de>
|
2011-01-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/AppKit/NSViewController.h,
|
* Headers/AppKit/NSViewController.h,
|
||||||
|
|
|
@ -4606,10 +4606,17 @@ current key view.<br />
|
||||||
// if toolbar is showing, adjust saved frame to add the toolbar back in
|
// if toolbar is showing, adjust saved frame to add the toolbar back in
|
||||||
if ([_toolbar isVisible])
|
if ([_toolbar isVisible])
|
||||||
{
|
{
|
||||||
int toolbarHeight = [[_toolbar _toolbarView] frame].size.height;
|
float toolbarHeight = [[_toolbar _toolbarView] frame].size.height;
|
||||||
fRect.size.height += toolbarHeight;
|
fRect.size.height += toolbarHeight;
|
||||||
fRect.origin.y -= toolbarHeight;
|
fRect.origin.y -= toolbarHeight;
|
||||||
}
|
}
|
||||||
|
// if window has a menu, adjust saved frame to add the menu back in
|
||||||
|
if ([_wv hasMenu])
|
||||||
|
{
|
||||||
|
float menuBarHeight = [[GSTheme theme] menuHeightForWindow: self];
|
||||||
|
fRect.size.height -= menuBarHeight;
|
||||||
|
fRect.origin.y -= menuBarHeight;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Scan in the frame for the area the window was placed in in screen.
|
* Scan in the frame for the area the window was placed in in screen.
|
||||||
|
@ -4739,10 +4746,17 @@ current key view.<br />
|
||||||
// if toolbar is showing, adjust saved frame to not include the toolbar
|
// if toolbar is showing, adjust saved frame to not include the toolbar
|
||||||
if ([_toolbar isVisible])
|
if ([_toolbar isVisible])
|
||||||
{
|
{
|
||||||
int toolbarHeight = [[_toolbar _toolbarView] frame].size.height;
|
float toolbarHeight = [[_toolbar _toolbarView] frame].size.height;
|
||||||
fRect.size.height -= toolbarHeight;
|
fRect.size.height -= toolbarHeight;
|
||||||
fRect.origin.y += toolbarHeight;
|
fRect.origin.y += toolbarHeight;
|
||||||
}
|
}
|
||||||
|
// if window has a menu, adjust saved frame to not include the menu
|
||||||
|
if ([_wv hasMenu])
|
||||||
|
{
|
||||||
|
float menuBarHeight = [[GSTheme theme] menuHeightForWindow: self];
|
||||||
|
fRect.size.height -= menuBarHeight;
|
||||||
|
fRect.origin.y += menuBarHeight;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The screen rectangle should give the area of the screen in which
|
* The screen rectangle should give the area of the screen in which
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue