Skip to content

Commit

Permalink
refactor(ui): Switch from PopThrough to Pop in Dialog (endless-sky#10425
Browse files Browse the repository at this point in the history
)

* The reasoning for using PopThrough (Dialog having child panels) was incorrect as those child panels are not on the UI stack.
  • Loading branch information
TomGoodIdea authored Aug 28, 2024
1 parent 7ea20b7 commit 7fdd879
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/Dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ bool Dialog::KeyDown(SDL_Keycode key, Uint16 mod, const Command &command, bool i
if(boolFun)
{
DoCallback(okIsActive);
// Use PopThrough because the Dialog has spawned additional panels.
GetUI()->PopThrough(this);
GetUI()->Pop(this);
}
else if(okIsActive || isMission)
{
Expand All @@ -276,11 +275,11 @@ bool Dialog::KeyDown(SDL_Keycode key, Uint16 mod, const Command &command, bool i
if(!isOkDisabled)
{
DoCallback();
GetUI()->PopThrough(this);
GetUI()->Pop(this);
}
}
else
GetUI()->PopThrough(this);
GetUI()->Pop(this);
}
else if((key == 'm' || command.Has(Command::MAP)) && system && player)
GetUI()->Push(new MapDetailPanel(*player, system));
Expand Down

0 comments on commit 7fdd879

Please sign in to comment.