mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
Add validation for toggle toolbar method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27471 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ae7cd302b8
commit
32bd8091d9
2 changed files with 29 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSWindow.m (-validateMenuItem:): Add validation for
|
||||
toolbar toggle method.
|
||||
|
||||
2008-12-30 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSPrintOperation.m (_setupPrintInfo): Initialize
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
#include "AppKit/NSTextFieldCell.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "AppKit/NSWindow+Toolbar.h"
|
||||
#include "AppKit/NSWindowController.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
#include "GNUstepGUI/GSTrackingRect.h"
|
||||
|
@ -4754,7 +4755,7 @@ current key view.<br />
|
|||
* Menu item validation
|
||||
*/
|
||||
|
||||
- (BOOL)validateMenuItem: (NSMenuItem *)anItem
|
||||
- (BOOL) validateMenuItem: (NSMenuItem *)anItem
|
||||
{
|
||||
BOOL result = YES;
|
||||
SEL action = [anItem action];
|
||||
|
@ -4813,6 +4814,28 @@ current key view.<br />
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (sel_eq(action, @selector(toggleToolbarShown:)))
|
||||
{
|
||||
NSToolbar *toolbar = [self toolbar];
|
||||
|
||||
if (toolbar == nil)
|
||||
{
|
||||
result = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([toolbar isVisible])
|
||||
{
|
||||
[anItem setTitle: _(@"Hide Toolbar")];
|
||||
result = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
[anItem setTitle: _(@"Show Toolbar")];
|
||||
result = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue