mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 12:50:47 +00:00
Merge fixes and additional merges
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38682 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9ad8451677
commit
ce265f56f8
8 changed files with 260 additions and 114 deletions
|
@ -132,29 +132,44 @@ static NSMapTable *viewInfo = 0;
|
|||
* Class methods.
|
||||
*/
|
||||
|
||||
static float menuBarHeight = 0.0;
|
||||
|
||||
+ (void) _themeWillDeactivate: (NSNotification*)n
|
||||
{
|
||||
/* Clear cached information from the old theme ... will get info from
|
||||
* the new theme as required.
|
||||
*/
|
||||
menuBarHeight = 0;
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (viewInfo == 0)
|
||||
{
|
||||
viewInfo = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 20);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||
selector: @selector(_themeWillDeactivate:)
|
||||
name: GSThemeWillDeactivateNotification
|
||||
object: nil];
|
||||
}
|
||||
}
|
||||
|
||||
+ (float) menuBarHeight
|
||||
{
|
||||
static float height = 0.0;
|
||||
|
||||
if (height == 0.0)
|
||||
if (menuBarHeight == 0.0)
|
||||
{
|
||||
const CGFloat themeHeight = [[GSTheme theme] menuBarHeight];
|
||||
|
||||
NSFont *font = [NSFont menuBarFontOfSize: 0.0];
|
||||
|
||||
height = [font boundingRectForFont].size.height;
|
||||
if (height < 22)
|
||||
height = 22;
|
||||
menuBarHeight = [font boundingRectForFont].size.height;
|
||||
if (menuBarHeight < themeHeight)
|
||||
menuBarHeight = themeHeight;
|
||||
}
|
||||
|
||||
return height;
|
||||
return menuBarHeight;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue