Move code of previous commit.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36906 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-07-18 23:04:22 +00:00
parent bb09eb6bca
commit 7eb3256964
3 changed files with 23 additions and 16 deletions

View file

@ -1,3 +1,10 @@
2013-07-18 German A. Arias <german@xelalug.org>
* Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Revert
last change.
* Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): Add here
the code. This place is more appropriate.
2013-07-17 German A. Arias <german@xelalug.org>
* Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Ensure

View file

@ -29,6 +29,7 @@
#import <Foundation/NSString.h>
#import <Foundation/NSArchiver.h>
#import "AppKit/NSMenu.h"
#import "AppKit/NSPanel.h"
#import "AppKit/NSWindow.h"
#import "AppKit/NSMenuView.h"
#import "AppKit/NSApplication.h"
@ -104,6 +105,21 @@
preferredEdge: (NSRectEdge)edge
selectedItem: (int)selectedItem
{
/* Ensure the window responds when run in modal and should
* process events. Or revert this if theme has changed.
*/
if ([[GSTheme theme] doesProcessEventsForPopUpMenu] &&
![[mr window] worksWhenModal])
{
[(NSPanel *)[mr window] setWorksWhenModal: YES];
}
if (![[GSTheme theme] doesProcessEventsForPopUpMenu] &&
[[mr window] worksWhenModal])
{
[(NSPanel *)[mr window] setWorksWhenModal: NO];
}
// Ask the MenuView to attach the menu to this rect
[mr setWindowFrameForAttachingToRect: cellFrame
onScreen: [cvWin screen]

View file

@ -36,7 +36,6 @@
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSMenu.h"
#import "AppKit/NSMenuView.h"
#import "AppKit/NSPanel.h"
#import "AppKit/NSPopUpButton.h"
#import "AppKit/NSPopUpButtonCell.h"
#import "AppKit/NSWindow.h"
@ -910,21 +909,6 @@ static NSImage *_pbc_image[5];
[nc postNotificationName: NSPopUpButtonWillPopUpNotification
object: controlView];
/* Ensure the window responds when run in modal and should
* process events. Or revert this if theme has changed.
*/
if ([[GSTheme theme] doesProcessEventsForPopUpMenu] &&
![[_menu window] worksWhenModal])
{
[(NSPanel *)[_menu window] setWorksWhenModal: YES];
}
if (![[GSTheme theme] doesProcessEventsForPopUpMenu] &&
[[_menu window] worksWhenModal])
{
[(NSPanel *)[_menu window] setWorksWhenModal: NO];
}
// Convert to Screen Coordinates
cellFrame = [controlView convertRect: cellFrame toView: nil];
cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin];