GUI: Fix top dialog only drawing

Before that the parent was also drawn.
This commit is contained in:
Le Philousophe 2022-11-01 17:01:08 +01:00
parent e51766c768
commit c6451a2ec9

View File

@ -393,15 +393,22 @@ void GuiManager::redraw() {
// This case is an optimization to avoid redrawing the whole dialog
// stack when opening a new dialog.
_theme->drawToBackbuffer();
if (_displayTopDialogOnly) {
// When displaying only the top dialog clear the screen
if (_redrawStatus == kRedrawOpenDialog) {
_theme->clearAll();
_theme->drawToBackbuffer();
}
} else {
_theme->drawToBackbuffer();
if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 1) {
Dialog *previousDialog = _dialogStack[_dialogStack.size() - 2];
previousDialog->drawDialog(kDrawLayerForeground);
}
if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 1) {
Dialog *previousDialog = _dialogStack[_dialogStack.size() - 2];
previousDialog->drawDialog(kDrawLayerForeground);
}
if (!_displayTopDialogOnly)
_theme->applyScreenShading(shading);
}
_dialogStack.top()->drawDialog(kDrawLayerBackground);