New: default menu system is now disable for every right click except for the CPTextField

Previously, when making a right click and when a cappuccino menu was not displayed, the system menu was displayed. Now we don't display this menu anymore as in cocoa. We only display when making a right click on a CPTextField.
This commit is contained in:
Alexandre Wilhelm
2015-08-20 16:14:14 -07:00
parent 655bc39d85
commit 2f79b079fd
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -1050,6 +1050,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
}
}
- (void)rightMouseDown:(CPEvent)anEvent
{
if ([self menuForEvent:anEvent] || [[self nextResponder] isKindOfClass:CPView])
[super rightMouseDown:anEvent];
else
[[[anEvent window] platformWindow] _propagateContextMenuDOMEvent:YES];
}
- (void)mouseDragged:(CPEvent)anEvent
{
if (![self isEnabled] || !([self isSelectable] || [self isEditable]))
+1 -1
View File
@@ -1831,7 +1831,7 @@ var CPViewHighDPIDrawingEnabled = YES;
else if ([[self nextResponder] isKindOfClass:CPView])
[super rightMouseDown:anEvent];
else
[[[anEvent window] platformWindow] _propagateContextMenuDOMEvent:YES];
[[[anEvent window] platformWindow] _propagateContextMenuDOMEvent:NO];
}
- (CPMenu)menuForEvent:(CPEvent)anEvent