From 424237e4d9b74bac7200b913cc46880ec75aa6cb Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sun, 29 Jan 2012 00:43:50 +0000 Subject: [PATCH] * Source/NSMenu.m (-setMain:): Remove the in-window menu when switching to a theme without that. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34652 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSMenu.m | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cf00587e..cd8e81f19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-28 Fred Kiefer + + * Source/NSMenu.m (-setMain:): Remove the in-window menu when + switching to a theme without that. + 2012-01-27 Fred Kiefer * Images/common_ToolbarClippedItemsMark.tiff: Revert to an older diff --git a/Source/NSMenu.m b/Source/NSMenu.m index d3d15eaed..a2630a5ce 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -2011,41 +2011,35 @@ static BOOL menuBarVisible = YES; [self setMenuRepresentation: newRep]; [self _organizeMenu]; RELEASE(newRep); - if (newStyle == NSWindows95InterfaceStyle) + if (oldStyle == NSWindows95InterfaceStyle) { - /* Put menu in the main window for microsoft style. + /* Remove the menu from all main windows. */ - [[NSApp mainWindow] setMenu: self]; - } - else if ([[NSApp mainWindow] menu] == self) - { - /* Remove the menu from the main window. - */ - [[NSApp mainWindow] setMenu: nil]; + [[GSTheme theme] updateAllWindowsWithMenu: nil]; } } /* Adjust the menu window to suit the menu view unless the menu * is being displayed in the application main window. */ - if ([[NSApp mainWindow] menu] != self) + if (newStyle != NSWindows95InterfaceStyle) { [[self window] setTitle: [[NSProcessInfo processInfo] processName]]; [[self window] setLevel: NSMainMenuWindowLevel]; [self _setGeometry]; [self sizeToFit]; } + else + { + /* Put menu in all main windows for microsoft style. + */ + [[GSTheme theme] updateAllWindowsWithMenu: self]; + } if ([NSApp isActive]) { [self display]; } - - if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == - NSWindows95InterfaceStyle) - { - [[GSTheme theme] updateAllWindowsWithMenu: self]; - } } else {