UI: fixed rare error with wrong dialog position after multiple popups (#4318);

This commit is contained in:
Oleg Agafonov 2019-03-28 09:19:16 +04:00
parent 14f90bfc77
commit c58b28f94f
12 changed files with 185 additions and 173 deletions

View file

@ -145,17 +145,14 @@ public class PickChoiceDialog extends MageDialog {
}
// window settings
MageFrame.getDesktop().remove(this);
if (this.isModal()) {
MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER);
} else {
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
}
if (mageDialogState != null) {
mageDialogState.setStateToDialog(this);
} else {
this.makeWindowCentered();
}
if (mageDialogState != null) mageDialogState.setStateToDialog(this);
else this.makeWindowCentered();
// final load
loadData();
@ -404,7 +401,7 @@ public class PickChoiceDialog extends MageDialog {
.addContainerGap())
);
panelCommandsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[]{btCancel, btOK});
panelCommandsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, btCancel, btOK);
panelCommandsLayout.setVerticalGroup(
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)