mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:27:40 +00:00
* Headers/Additions/GNUstepGUI/GSTheme.h: Added methods
to support adding menus and processing commands from windows, if appropriate. * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h: Added new methods for menu and toolbar flags. * Headers/AppKit/NSInterfaceStyle.h: Added new interface style. * Source/GNUmakefile: Added header. * Source/GSStandardWindowDecorationView.m: Change include to include header in new location. * Source/GSThemeMenu.m: Default theme implementation for Menus. * Source/GSWindowDecorationView.m: Add the setHasMenu:/setHasToolbar: flags. * Source/NSWindow.m: Use the theme to set the menu instead of setting it directly. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29271 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b89db86a92
commit
ebebc38558
9 changed files with 260 additions and 33 deletions
|
@ -78,14 +78,16 @@
|
|||
#include "AppKit/NSWindowController.h"
|
||||
#include "GSBindingHelpers.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
#include "GNUstepGUI/GSTheme.h"
|
||||
#include "GNUstepGUI/GSTrackingRect.h"
|
||||
#include "GNUstepGUI/GSDisplayServer.h"
|
||||
#include "GSGuiPrivate.h"
|
||||
#include "GSToolTips.h"
|
||||
#include "GSIconManager.h"
|
||||
#include "GSWindowDecorationView.h"
|
||||
#include "NSToolbarFrameworkPrivate.h"
|
||||
|
||||
#include <GNUstepGUI/GSWindowDecorationView.h>
|
||||
|
||||
#define GSI_ARRAY_TYPES 0
|
||||
#define GSI_ARRAY_TYPE NSWindow *
|
||||
#define GSI_ARRAY_NO_RELEASE 1
|
||||
|
@ -5321,32 +5323,11 @@ current key view.<br />
|
|||
|
||||
- (void) setMenu: (NSMenu *)menu
|
||||
{
|
||||
if ([self menu] != menu)
|
||||
{
|
||||
NSMenuView *menuView;
|
||||
// Do theme specific logic...
|
||||
[[GSTheme theme] setMenu: menu forWindow: self];
|
||||
|
||||
/* Restore the old representation to its original menu after
|
||||
* removing it from the window. If we didn't do this, the menu
|
||||
* representation would be left without a partent view or
|
||||
* window to draw in.
|
||||
*/
|
||||
menuView = [_wv removeMenuView];
|
||||
[[self menu] setMenuRepresentation: menuView];
|
||||
[menuView sizeToFit];
|
||||
|
||||
/* Set the new menu, and transfer the new menu representation
|
||||
* to the window decoration view.
|
||||
*/
|
||||
[super setMenu: menu];
|
||||
menuView = [menu menuRepresentation];
|
||||
if (menuView != nil)
|
||||
{
|
||||
[menu close];
|
||||
[menuView setHorizontal: YES];
|
||||
[menuView sizeToFit];
|
||||
[_wv addMenuView: menuView];
|
||||
}
|
||||
}
|
||||
if([self menu] != menu)
|
||||
[super setMenu: menu];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue