mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:10:38 +00:00
Modified to allow changing menu font and size
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8721 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1f3281b4fa
commit
0e6f6648d3
1 changed files with 7 additions and 4 deletions
|
@ -34,8 +34,6 @@
|
|||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||
|
||||
// FIXME Check this strange comment:
|
||||
// These private methods are used in NSPopUpButton. For NSPB we need to be
|
||||
// able to init with a frame, but have a very custom cell size.
|
||||
|
@ -51,7 +49,10 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
|||
*/
|
||||
+ (float) menuBarHeight
|
||||
{
|
||||
return GSMenuBarHeight;
|
||||
NSFont *font = [NSFont menuFontOfSize: 0.0];
|
||||
|
||||
//static float GSMenuBarHeight = 25.0; - A wild guess for default font.
|
||||
return [font boundingRectForFont].size.height + 10;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -72,7 +73,9 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
|||
|
||||
- (id) initWithFrame: (NSRect)aFrame
|
||||
{
|
||||
cellSize = NSMakeSize(110,20);
|
||||
NSRect r = [[NSFont menuFontOfSize: 0.0] boundingRectForFont];
|
||||
/* Should make up 110, 20 for default font */
|
||||
cellSize = NSMakeSize (r.size.width * 10., r.size.height + 5.);
|
||||
|
||||
menuv_highlightedItemIndex = -1;
|
||||
menuv_horizontalEdgePad = 4.;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue