mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
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:
parent
7026811cd3
commit
d604f04b79
3 changed files with 8 additions and 4 deletions
|
@ -58,16 +58,19 @@ public class UserRequestDialog extends MageDialog {
|
|||
this.lblText.setText(text);
|
||||
if (userRequestMessage.getButton1Text() != null) {
|
||||
this.btn1.setText(userRequestMessage.getButton1Text());
|
||||
this.btn1.setFocusable(false);
|
||||
} else {
|
||||
this.btn1.setVisible(false);
|
||||
}
|
||||
if (userRequestMessage.getButton2Text() != null) {
|
||||
this.btn2.setText(userRequestMessage.getButton2Text());
|
||||
this.btn2.setFocusable(false);
|
||||
} else {
|
||||
this.btn2.setVisible(false);
|
||||
}
|
||||
if (userRequestMessage.getButton3Text() != null) {
|
||||
this.btn3.setText(userRequestMessage.getButton3Text());
|
||||
this.btn3.setFocusable(false);
|
||||
} else {
|
||||
this.btn3.setVisible(false);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -490,8 +490,8 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
|
||||
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 tournament?");
|
||||
message.setButton1("Yes", PlayerAction.CLIENT_QUIT_TOURNAMENT);
|
||||
message.setButton2("No", null);
|
||||
message.setButton1("No", null);
|
||||
message.setButton2("Yes", PlayerAction.CLIENT_QUIT_TOURNAMENT);
|
||||
message.setTournamentId(tournamentId);
|
||||
MageFrame.getInstance().showUserRequestDialog(message);
|
||||
}//GEN-LAST:event_btnQuitTournamentActionPerformed
|
||||
|
|
Loading…
Reference in a new issue