Permalink
Browse files

Merge branch 'master' of github.com:280north/cappuccino

  • Loading branch information...
2 parents dd5d8fc + f241142 commit fcaf672bf89b41f9d08c20e7e5a54937fcf2c204 @aljungberg aljungberg committed Jul 29, 2011
Showing with 11 additions and 12 deletions.
  1. +3 −3 AppKit/CPMenu/CPMenu.j
  2. +7 −0 AppKit/CPMenu/_CPMenuManager.j
  3. +0 −8 AppKit/CPMenuItem/CPMenuItem.j
  4. +1 −1 Tools/xcodecapp-cocoa/Jakefile
View
6 AppKit/CPMenu/CPMenu.j
@@ -622,11 +622,11 @@ var _CPMenuBarVisible = NO,
var validator = [CPApp targetForAction:[item action] to:[item target] from:item];
if (!validator || ![validator respondsToSelector:[item action]])
- [item _setEnabled:NO];
+ [item setEnabled:NO];
else if ([validator respondsToSelector:@selector(validateMenuItem:)])
- [item _setEnabled:[validator validateMenuItem:item]];
+ [item setEnabled:[validator validateMenuItem:item]];
else if ([validator respondsToSelector:@selector(validateUserInterfaceItem:)])
- [item _setEnabled:[validator validateUserInterfaceItem:item]];
+ [item setEnabled:[validator validateUserInterfaceItem:item]];
}
[[_menuWindow _menuView] tile];
View
7 AppKit/CPMenu/_CPMenuManager.j
@@ -230,7 +230,14 @@ var STICKY_TIME_INTERVAL = 500,
else if (type === CPLeftMouseUp || type === CPRightMouseUp)
{
if (_hasMouseGoneUpAfterStartedTracking)
+ {
+ // Don't close the menu if the current item has a submenu
+ // and did not override it's default action
+ if ([activeItem action] === @selector(submenuAction:))
+ return;
+
[trackingMenu cancelTracking];
+ }
else
_hasMouseGoneUpAfterStartedTracking = YES;
}
View
8 AppKit/CPMenuItem/CPMenuItem.j
@@ -149,14 +149,6 @@ var CPMenuItemStringRepresentationDictionary = [CPDictionary dictionary];
*/
- (void)setEnabled:(BOOL)isEnabled
{
- if ([_menu autoenablesItems])
- return;
-
- [self _setEnabled:isEnabled];
-}
-
-- (void)_setEnabled:(BOOL)isEnabled
-{
if (_isEnabled === isEnabled)
return;
View
2 Tools/xcodecapp-cocoa/Jakefile
@@ -34,7 +34,7 @@ task ("build", function()
}
else
{
- print("Building "+xcodecapp-cocoa+" requires Xcode.");
+ print("Building " + applicationName + " requires Xcode.");
}
});

0 comments on commit fcaf672

Please sign in to comment.