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 -> {
|
Base.registerWindowCloseKeys(getRootPane(), e -> {
|
||||||
if (OSUtils.isWindows()) {
|
|
||||||
setAutoRequestFocus(true);
|
setAutoRequestFocus(true);
|
||||||
}
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
Base.FIND_DIALOG_STATE = findDialogState();
|
Base.FIND_DIALOG_STATE = findDialogState();
|
||||||
});
|
});
|
||||||
@ -83,40 +81,18 @@ public class FindReplace extends javax.swing.JFrame {
|
|||||||
|
|
||||||
editor.addWindowListener(new WindowAdapter() {
|
editor.addWindowListener(new WindowAdapter() {
|
||||||
public void windowActivated(WindowEvent e) {
|
public void windowActivated(WindowEvent e) {
|
||||||
if (OSUtils.isWindows()) {
|
|
||||||
toFront();
|
toFront();
|
||||||
setAutoRequestFocus(false);
|
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) {
|
public void windowDeactivated(WindowEvent e) {
|
||||||
if (OSUtils.isWindows()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setAlwaysOnTop(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
addWindowListener(new WindowAdapter() {
|
addWindowListener(new WindowAdapter() {
|
||||||
public void windowActivated(WindowEvent e) {
|
public void windowActivated(WindowEvent e) {
|
||||||
if (OSUtils.isWindows()) {
|
|
||||||
return;
|
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) {
|
public void windowDeactivated(WindowEvent e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -127,12 +103,8 @@ public class FindReplace extends javax.swing.JFrame {
|
|||||||
@Override
|
@Override
|
||||||
public void setVisible(boolean b) {
|
public void setVisible(boolean b) {
|
||||||
getRootPane().setDefaultButton(findButton);
|
getRootPane().setDefaultButton(findButton);
|
||||||
|
|
||||||
if (OSUtils.isWindows()) {
|
|
||||||
// means we are restoring the window visibility
|
// means we are restoring the window visibility
|
||||||
setAutoRequestFocus(true);
|
setAutoRequestFocus(true);
|
||||||
}
|
|
||||||
|
|
||||||
super.setVisible(b);
|
super.setVisible(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user