forked from External/mage
UI: fixed rare error with wrong dialog position after multiple popups (#4318);
This commit is contained in:
parent
14f90bfc77
commit
c58b28f94f
12 changed files with 185 additions and 173 deletions
|
|
@ -114,14 +114,15 @@ public class AddLandDialog extends MageDialog {
|
|||
}
|
||||
|
||||
getRootPane().setDefaultButton(btnOK);
|
||||
this.makeWindowCentered();
|
||||
|
||||
// windows settings
|
||||
MageFrame.getDesktop().remove(this);
|
||||
if (this.isModal()) {
|
||||
MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER);
|
||||
} else {
|
||||
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
||||
}
|
||||
this.makeWindowCentered();
|
||||
|
||||
// Close on "ESC"
|
||||
registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue