Button focus adjustments for yes/no dialogs (#9828)

* UserRequestDialog buttons can't be pressed with spacebar anymore

* Pressing spacebar when drafting no longer brings up the quit menu

* Revert DraftPanel and TournamentPanel quit dialog buttons to their original positions

Co-authored-by: sprangg <a@b.c>
This commit is contained in:
sprangg 2022-12-26 18:09:41 +02:00 committed by GitHub
parent 7026811cd3
commit d604f04b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View file

@ -526,6 +526,7 @@
draftLeftPane.setVerifyInputWhenFocusTarget(false);
btnQuitTournament.setText("Quit Tournament");
btnQuitTournament.setFocusable(false);
btnQuitTournament.addActionListener(evt -> btnQuitTournamentActionPerformed(evt));
lblPack1.setText("Pack 1:");
@ -825,8 +826,8 @@
private void btnQuitTournamentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitTournamentActionPerformed
UserRequestMessage message = new UserRequestMessage("Confirm quit tournament", "Are you sure you want to quit the draft tournament?");
message.setButton1("Yes", PlayerAction.CLIENT_QUIT_DRAFT_TOURNAMENT);
message.setButton2("No", null);
message.setButton1("No", null);
message.setButton2("Yes", PlayerAction.CLIENT_QUIT_DRAFT_TOURNAMENT);
message.setTournamentId(draftId);
MageFrame.getInstance().showUserRequestDialog(message);
}//GEN-LAST:event_btnQuitTournamentActionPerformed