Make "show next option button popup" action to skip disabled buttons

This commit is contained in:
Konstantin Kolosovsky
2018-01-30 01:13:45 +03:00
parent 10ec4e0534
commit a658faacf5
@@ -1336,15 +1336,11 @@ public abstract class DialogWrapper {
}
private void expandNextOptionButton() {
if (myCurrentOptionsButtonIndex > 0) {
if (myCurrentOptionsButtonIndex >= 0) {
myOptionsButtons.get(myCurrentOptionsButtonIndex).closePopup();
myCurrentOptionsButtonIndex++;
}
else if (!myOptionsButtons.isEmpty()) {
myCurrentOptionsButtonIndex = 0;
}
if (myCurrentOptionsButtonIndex >= 0 && myCurrentOptionsButtonIndex < myOptionsButtons.size()) {
myCurrentOptionsButtonIndex = getEnabledIndexCyclic(myOptionsButtons, myCurrentOptionsButtonIndex, true).orElse(-1);
if (myCurrentOptionsButtonIndex >= 0) {
myOptionsButtons.get(myCurrentOptionsButtonIndex).showPopup(null, true);
}
}