mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
FindReplace: setting default button each time the window is made visible, because Find button was let unselected with subsequent Edit>Find clicks on Windows. Fixes #3959
This commit is contained in:
parent
67e32ff8fa
commit
320dcef67e
@ -66,8 +66,6 @@ public class FindReplace extends javax.swing.JFrame {
|
|||||||
buttonsContainer.add(findButton);
|
buttonsContainer.add(findButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRootPane().setDefaultButton(findButton);
|
|
||||||
|
|
||||||
Base.registerWindowCloseKeys(getRootPane(), e -> {
|
Base.registerWindowCloseKeys(getRootPane(), e -> {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
Base.FIND_DIALOG_STATE = findDialogState();
|
Base.FIND_DIALOG_STATE = findDialogState();
|
||||||
@ -85,6 +83,13 @@ public class FindReplace extends javax.swing.JFrame {
|
|||||||
restoreFindDialogState(state);
|
restoreFindDialogState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisible(boolean b) {
|
||||||
|
getRootPane().setDefaultButton(findButton);
|
||||||
|
|
||||||
|
super.setVisible(b);
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String, Object> findDialogState() {
|
private Map<String, Object> findDialogState() {
|
||||||
Map<String, Object> state = new HashMap<>();
|
Map<String, Object> state = new HashMap<>();
|
||||||
state.put(FIND_TEXT, findField.getText());
|
state.put(FIND_TEXT, findField.getText());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user