mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
Return focus back to top-most dialog after showNotification() dialog is closed #PL-4960
This commit is contained in:
parent
33f33700e5
commit
73a4c6082b
@ -1046,10 +1046,10 @@ public class DesktopWindow implements Window, Component.Disposable,
|
||||
if (errors.isEmpty())
|
||||
return true;
|
||||
|
||||
showValidationErrors(errors);
|
||||
|
||||
focusProblemComponent(errors);
|
||||
|
||||
showValidationErrors(errors);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1345,7 +1345,8 @@ public class DesktopWindowManager extends WindowManager {
|
||||
if (icon != null) {
|
||||
panel.add(new JLabel(" "));
|
||||
}
|
||||
panel.add(createButtonsPanel(actions, dialog), "alignx right");
|
||||
final JPanel buttonsPanel = createButtonsPanel(actions, dialog);
|
||||
panel.add(buttonsPanel, "alignx right");
|
||||
|
||||
dialog.setLayout(new MigLayout(new LC().insets("0").width(width + "px")));
|
||||
dialog.setFixedWidth(width);
|
||||
@ -1368,6 +1369,11 @@ public class DesktopWindowManager extends WindowManager {
|
||||
}
|
||||
|
||||
dialog.requestFocus();
|
||||
dialog.requestFocusInWindow();
|
||||
|
||||
if (buttonsPanel.getComponentCount() == 1) {
|
||||
buttonsPanel.getComponent(0).requestFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.setVisible(true);
|
||||
|
Loading…
Reference in New Issue
Block a user