mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-47906 alt+i (shortcut to press the commit button) does not work on the commit dialog
This commit is contained in:
@@ -151,10 +151,7 @@ public class MnemonicHelper extends ComponentTreeWatcher {
|
||||
*/
|
||||
public static CustomShortcutSet createShortcut(char ch) {
|
||||
Character mnemonic = Character.valueOf(ch);
|
||||
String shortcut = SystemInfo.isMac && SystemInfo.isJavaVersionAtLeast("1.7")
|
||||
? "control alt pressed "
|
||||
: "alt pressed ";
|
||||
return CustomShortcutSet.fromString(shortcut + mnemonic);
|
||||
return CustomShortcutSet.fromString("alt " + (SystemInfo.isMac ? "released" : "pressed") + " " + mnemonic);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -750,7 +750,7 @@ public abstract class DialogWrapper {
|
||||
final char mnemonic = (char)eachInfo.getMnemonic();
|
||||
JRootPane rootPane = getPeer().getRootPane();
|
||||
if (rootPane != null) {
|
||||
new DumbAwareAction() {
|
||||
new DumbAwareAction("Show JBOptionButton popup") {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final JBOptionButton buttonToActivate = eachInfo.getButton();
|
||||
|
||||
+3
-5
@@ -420,10 +420,8 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
|
||||
if (SystemInfo.isMac) {
|
||||
boolean keyTyped = e.getID() == KeyEvent.KEY_TYPED;
|
||||
boolean hasMnemonicsInWindow = (e.getID() == KeyEvent.KEY_PRESSED
|
||||
|| e.getID() == KeyEvent.KEY_RELEASED)
|
||||
&& hasMnemonicInWindow(focusOwner, e.getKeyCode());
|
||||
|
||||
boolean hasMnemonicsInWindow = e.getID() == KeyEvent.KEY_PRESSED && hasMnemonicInWindow(focusOwner, e.getKeyCode()) ||
|
||||
keyTyped && hasMnemonicInWindow(focusOwner, e.getKeyChar());
|
||||
boolean imEnabled = IdeEventQueue.getInstance().isInputMethodEnabled();
|
||||
|
||||
if (e.getModifiersEx() == InputEvent.ALT_DOWN_MASK && (hasMnemonicsInWindow || !imEnabled && keyTyped)) {
|
||||
@@ -499,7 +497,7 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
|
||||
private static boolean hasMnemonicInWindow(Component focusOwner, int keyCode) {
|
||||
if (keyCode == KeyEvent.VK_ALT || keyCode == 0) return false; // Optimization
|
||||
final Container container = SwingUtilities.getWindowAncestor(focusOwner);
|
||||
final Container container = UIUtil.getWindow(focusOwner);
|
||||
return hasMnemonic(container, keyCode) || hasMnemonicInBalloons(container, keyCode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user