Merge remote-tracking branch 'origin/GP-4558_ghidragon_action_chooser_dialog_bugs'

This commit is contained in:
Ryan Kurtz
2024-04-25 09:38:20 -04:00
2 changed files with 4 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ public class ShowActionChooserDialogAction extends DockingAction {
Tool tool = DockingWindowManager.getActiveInstance().getTool(); Tool tool = DockingWindowManager.getActiveInstance().getTool();
if (focusedWindow instanceof DockingDialog dialog) { if (focusedWindow instanceof DockingDialog dialog) {
context = dialog.getDialogComponent().getActionContext(null);
showActionsDialog(tool, dialog, context); showActionsDialog(tool, dialog, context);
} }
else if (focusedWindow instanceof DockingFrame dockingFrame) { else if (focusedWindow instanceof DockingFrame dockingFrame) {

View File

@@ -63,6 +63,7 @@ public class ActionChooserDialog extends DialogComponentProvider {
"This dialog initialy shows only locally relevant actions. Repeat initial keybinding " + "This dialog initialy shows only locally relevant actions. Repeat initial keybinding " +
"to show More. Use up down arrows to scroll through list of actions and press" + "to show More. Use up down arrows to scroll through list of actions and press" +
" enter to invoke selected action. Type text to filter list."); " enter to invoke selected action. Type text to filter list.");
setOkEnabled(false);
} }
@Override @Override
@@ -308,7 +309,8 @@ public class ActionChooserDialog extends DialogComponentProvider {
Color fgName = getForeground(); // defaults to list foreground; handles selected state Color fgName = getForeground(); // defaults to list foreground; handles selected state
Color fgKeyBinding = isSelected ? getForeground() : Messages.HINT; Color fgKeyBinding = isSelected ? getForeground() : Messages.HINT;
if (!action.isEnabled()) { ActionContext context = model.getContext();
if (!(action.isValidContext(context) && action.isEnabledForContext(context))) {
fgName = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED; fgName = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED;
fgKeyBinding = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED; fgKeyBinding = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED;
disabledText = isSelected ? " <I>disabled</I>" : ""; disabledText = isSelected ? " <I>disabled</I>" : "";