Don't pop a disabled radial menu down when it's clicked. That makes it look

like we're taking the menu's action.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2517 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-12-29 22:57:56 +00:00
parent cc88420aa2
commit 0d0787348e
@@ -435,14 +435,13 @@ public class RadialMenu
{ {
if (_activeItem == null) { if (_activeItem == null) {
long when = RunAnywhere.getWhen(event); long when = RunAnywhere.getWhen(event);
if (!_msMode && if (!_msMode && (when < _poptime + DRAGMODE_DELAY)) {
(when < _poptime + DRAGMODE_DELAY)) {
// if the dragmode delay time hasn't passed, then we're going to leave the menu up // if the dragmode delay time hasn't passed, then we're going to leave the menu up
// because the user wants it to behave like a MS Windows menu. // because the user wants it to behave like a MS Windows menu.
_msMode = true; _msMode = true;
return; return;
// if they've double clicked, then activate the default item // if they've double clicked, then activate the default item
} else if (_msMode && (when < _poptime + DOUBLECLICK_DELAY)) { } else if (_msMode && (when < _poptime + DOUBLECLICK_DELAY)) {
_activeItem = _defaultItem; _activeItem = _defaultItem;
} }
@@ -451,8 +450,12 @@ public class RadialMenu
// deactivate the active item and post a command for it // deactivate the active item and post a command for it
if (_activeItem != null) { if (_activeItem != null) {
// only process the selection if the item is enabled // only process the selection if the item is enabled
if (_activeItem.isEnabled(this) && _activeItem.command != null) { if (!_activeItem.isEnabled(this)) {
// if the item has an overriding argument, use that return;
}
// if the item has an overriding argument, use that
if (_activeItem.command != null) {
Object itemArg = _activeItem.argument; Object itemArg = _activeItem.argument;
Object arg = (itemArg == null) ? _argument : itemArg; Object arg = (itemArg == null) ? _argument : itemArg;
@@ -466,6 +469,7 @@ public class RadialMenu
} }
}); });
} }
_activeItem.setActive(false); _activeItem.setActive(false);
_activeItem = null; _activeItem = null;
} }