mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Use Windows method for all OS
This commit is contained in:
parent
71418caa4b
commit
1d2c8fa9af
@ -72,9 +72,7 @@ public class FindReplace extends javax.swing.JFrame {
|
||||
}
|
||||
|
||||
Base.registerWindowCloseKeys(getRootPane(), e -> {
|
||||
if (OSUtils.isWindows()) {
|
||||
setAutoRequestFocus(true);
|
||||
}
|
||||
setVisible(false);
|
||||
Base.FIND_DIALOG_STATE = findDialogState();
|
||||
});
|
||||
@ -83,40 +81,18 @@ public class FindReplace extends javax.swing.JFrame {
|
||||
|
||||
editor.addWindowListener(new WindowAdapter() {
|
||||
public void windowActivated(WindowEvent e) {
|
||||
if (OSUtils.isWindows()) {
|
||||
toFront();
|
||||
setAutoRequestFocus(false);
|
||||
return;
|
||||
}
|
||||
findField.requestFocusInWindow();
|
||||
findField.selectAll();
|
||||
setAlwaysOnTop(true);
|
||||
if (useTranslucency) {
|
||||
// Window is decorated, so tranparency doesn't work :(
|
||||
//setOpacity(0.7f);
|
||||
}
|
||||
}
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
if (OSUtils.isWindows()) {
|
||||
return;
|
||||
}
|
||||
setAlwaysOnTop(false);
|
||||
}
|
||||
});
|
||||
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowActivated(WindowEvent e) {
|
||||
if (OSUtils.isWindows()) {
|
||||
return;
|
||||
}
|
||||
findField.requestFocusInWindow();
|
||||
findField.selectAll();
|
||||
setAlwaysOnTop(true);
|
||||
if (useTranslucency) {
|
||||
// Window is decorated, so tranparency doesn't work :(
|
||||
//setOpacity(1.0f);
|
||||
}
|
||||
}
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
}
|
||||
});
|
||||
@ -127,12 +103,8 @@ public class FindReplace extends javax.swing.JFrame {
|
||||
@Override
|
||||
public void setVisible(boolean b) {
|
||||
getRootPane().setDefaultButton(findButton);
|
||||
|
||||
if (OSUtils.isWindows()) {
|
||||
// means we are restoring the window visibility
|
||||
setAutoRequestFocus(true);
|
||||
}
|
||||
|
||||
super.setVisible(b);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user