Skip to content

Commit

Permalink
fix changing size of the interface terminal switching to a different …
Browse files Browse the repository at this point in the history
…GUI entirely
  • Loading branch information
Alexdoru committed Nov 13, 2024
1 parent 12ebe0b commit fa5491e
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,19 @@ protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
return;
}
super.mouseClicked(xCoord, yCoord, btn);
if (doDelayedGuiInit) {
// the super.mouseClicked call just above ends up looping on the button list
// and execute the action for any button below the mouse.
// Therefore, if we initGui() the terminal in the actionPerformed method below
// it will run the actionPerformed a second time for the new button
// that will end up being below the mouse after the initGui()
initGui();
doDelayedGuiInit = false;
}
}

private boolean doDelayedGuiInit;

@Override
protected void actionPerformed(final GuiButton btn) {
if (btn == guiButtonAssemblersOnly) {
Expand All @@ -323,7 +334,7 @@ protected void actionPerformed(final GuiButton btn) {

if (btn == this.terminalStyleBox) {
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
initGui();
doDelayedGuiInit = true;
} else if (btn == searchStringSave) {
AEConfig.instance.preserveSearchBar = next == YesNo.YES;
}
Expand Down

0 comments on commit fa5491e

Please sign in to comment.