mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Support disabling combo boxes appropriately
This commit is contained in:
@@ -87,6 +87,14 @@ public class FDeckImportDialog extends FDialog {
|
||||
for (DeckRecognizer.Token token : tokens) {
|
||||
if (token.getType() == TokenType.KnownCard) {
|
||||
showOptions = true;
|
||||
|
||||
dateTimeCheck.setCommand(new FEventHandler() {
|
||||
@Override
|
||||
public void handleEvent(FEvent e) {
|
||||
updateDropDownEnabled();
|
||||
}
|
||||
});
|
||||
updateDropDownEnabled();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -96,6 +104,12 @@ public class FDeckImportDialog extends FDialog {
|
||||
txtInput.setText("No known cards found on clipboard.\n\nCopy the decklist to the clipboard, then reopen this dialog.");
|
||||
}
|
||||
|
||||
private void updateDropDownEnabled() {
|
||||
boolean enabled = dateTimeCheck.isSelected();
|
||||
monthDropdown.setEnabled(enabled);
|
||||
yearDropdown.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawOverlay(Graphics g) {
|
||||
super.drawOverlay(g);
|
||||
|
||||
Reference in New Issue
Block a user