mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-133661 Activate welcome screen action buttons by Enter
GitOrigin-RevId: 3f3ac822f313eec41c54a5dee7cde16371c092d9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
37d6be2e7d
commit
71cc2cfdad
+19
-3
@@ -19,9 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.*;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager.getActionsButtonBackground;
|
||||
@@ -43,6 +41,16 @@ final class WelcomeScreenActionsUtil {
|
||||
if (actions != null && actions.size() > 1) {
|
||||
button.setOptions(actions);
|
||||
}
|
||||
else {
|
||||
button.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
button.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
button.setBackground(WelcomeScreenUIManager.getMainAssociatedComponentBackground());
|
||||
button.putClientProperty(JBOptionButton.PLACE, place);
|
||||
return button;
|
||||
@@ -99,6 +107,14 @@ final class WelcomeScreenActionsUtil {
|
||||
updateIconBackground(false);
|
||||
}
|
||||
});
|
||||
myIconButton.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
myIconButton.doClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
Wrapper iconWrapper = new Wrapper(myIconButton);
|
||||
iconWrapper.setFocusable(false);
|
||||
iconWrapper.setBorder(JBUI.Borders.empty(0, 30));
|
||||
|
||||
Reference in New Issue
Block a user