GUI: Remove Dialog::markAsDirty to expose full GUI redraws

This commit is contained in:
Bastien Bouclet 2018-01-06 16:13:29 +01:00
parent fc37918130
commit 5878c618c9
23 changed files with 84 additions and 89 deletions

View file

@ -451,7 +451,7 @@ void RemapDialog::refreshKeymap() {
} }
// need to redraw entire Dialog so that invisible // need to redraw entire Dialog so that invisible
// widgets disappear // widgets disappear
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }

View file

@ -358,7 +358,7 @@ void HelpDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 da
_prevButton->setFlags(WIDGET_ENABLED); _prevButton->setFlags(WIDGET_ENABLED);
} }
displayKeyBindings(); displayKeyBindings();
draw(); g_gui.scheduleTopDialogRedraw();
break; break;
case kPrevCmd: case kPrevCmd:
_page--; _page--;
@ -369,7 +369,7 @@ void HelpDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 da
_prevButton->clearFlags(WIDGET_ENABLED); _prevButton->clearFlags(WIDGET_ENABLED);
} }
displayKeyBindings(); displayKeyBindings();
draw(); g_gui.scheduleTopDialogRedraw();
break; break;
default: default:
ScummDialog::handleCommand(sender, cmd, data); ScummDialog::handleCommand(sender, cmd, data);
@ -553,7 +553,7 @@ void ValueDisplayDialog::handleKeyDown(Common::KeyState state) {
setResult(_value); setResult(_value);
_timer = g_system->getMillis() + kDisplayDelay; _timer = g_system->getMillis() + kDisplayDelay;
draw(); g_gui.scheduleTopDialogRedraw();
} else { } else {
close(); close();
} }
@ -581,7 +581,7 @@ void SubtitleSettingsDialog::handleKeyDown(Common::KeyState state) {
cycleValue(); cycleValue();
reflowLayout(); reflowLayout();
draw(); g_gui.scheduleTopDialogRedraw();
} else { } else {
close(); close();
} }
@ -634,7 +634,7 @@ void DebugInputDialog::handleKeyDown(Common::KeyState state) {
buffer.deleteLastChar(); buffer.deleteLastChar();
Common::String total = mainText + ' ' + buffer; Common::String total = mainText + ' ' + buffer;
setInfoText(total); setInfoText(total);
draw(); g_gui.scheduleTopDialogRedraw();
reflowLayout(); reflowLayout();
} else if (state.keycode == Common::KEYCODE_RETURN) { } else if (state.keycode == Common::KEYCODE_RETURN) {
done = 1; done = 1;
@ -643,7 +643,7 @@ void DebugInputDialog::handleKeyDown(Common::KeyState state) {
} else if ((state.ascii >= '0' && state.ascii <= '9') || (state.ascii >= 'A' && state.ascii <= 'Z') || (state.ascii >= 'a' && state.ascii <= 'z') || state.ascii == '.' || state.ascii == ' ') { } else if ((state.ascii >= '0' && state.ascii <= '9') || (state.ascii >= 'A' && state.ascii <= 'Z') || (state.ascii >= 'a' && state.ascii <= 'z') || state.ascii == '.' || state.ascii == ' ') {
buffer += state.ascii; buffer += state.ascii;
Common::String total = mainText + ' ' + buffer; Common::String total = mainText + ' ' + buffer;
draw(); g_gui.scheduleTopDialogRedraw();
reflowLayout(); reflowLayout();
setInfoText(total); setInfoText(total);
} }

View file

@ -21,6 +21,7 @@
*/ */
#include "gui/browser.h" #include "gui/browser.h"
#include "gui/gui-manager.h"
#include "gui/widgets/list.h" #include "gui/widgets/list.h"
#include "common/config-manager.h" #include "common/config-manager.h"
@ -191,7 +192,7 @@ void BrowserDialog::updateListing() {
_fileList->scrollTo(0); _fileList->scrollTo(0);
// Finally, redraw // Finally, redraw
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} // End of namespace GUI } // End of namespace GUI

View file

@ -214,7 +214,7 @@ void ConsoleDialog::reflowLayout() {
updateScrollBuffer(); updateScrollBuffer();
Dialog::reflowLayout(); Dialog::reflowLayout();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void ConsoleDialog::handleTickle() { void ConsoleDialog::handleTickle() {
@ -237,13 +237,13 @@ void ConsoleDialog::handleTickle() {
// End the slide // End the slide
_slideMode = kNoSlideMode; _slideMode = kNoSlideMode;
_y = 0; _y = 0;
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} else if (_slideMode == kUpSlideMode && _y <= -_h) { } else if (_slideMode == kUpSlideMode && _y <= -_h) {
// End the slide // End the slide
//_slideMode = kNoSlideMode; //_slideMode = kNoSlideMode;
close(); close();
} else } else
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
_scrollBar->handleTickle(); _scrollBar->handleTickle();
@ -292,7 +292,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
print(PROMPT); print(PROMPT);
_promptStartPos = _promptEndPos = _currentPos; _promptStartPos = _promptEndPos = _currentPos;
markAsDirty(); g_gui.scheduleTopDialogRedraw();
if (!keepRunning) if (!keepRunning)
slideUpAndClose(); slideUpAndClose();
break; break;
@ -377,7 +377,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
} else { } else {
_currentPos = _promptEndPos; _currentPos = _promptEndPos;
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case Common::KEYCODE_KP2: case Common::KEYCODE_KP2:
@ -405,7 +405,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
_scrollLine = _firstLineInBuffer + _linesPerPage - 1; _scrollLine = _firstLineInBuffer + _linesPerPage - 1;
} }
updateScrollBuffer(); updateScrollBuffer();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
@ -446,7 +446,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
} else { } else {
_currentPos = _promptStartPos; _currentPos = _promptStartPos;
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case Common::KEYCODE_KP8: case Common::KEYCODE_KP8:
@ -471,7 +471,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1) if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1)
_scrollLine = _firstLineInBuffer + _linesPerPage - 1; _scrollLine = _firstLineInBuffer + _linesPerPage - 1;
updateScrollBuffer(); updateScrollBuffer();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
@ -508,7 +508,7 @@ void ConsoleDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
int newPos = (int)data + _linesPerPage - 1 + _firstLineInBuffer; int newPos = (int)data + _linesPerPage - 1 + _firstLineInBuffer;
if (newPos != _scrollLine) { if (newPos != _scrollLine) {
_scrollLine = newPos; _scrollLine = newPos;
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -518,25 +518,25 @@ void ConsoleDialog::specialKeys(int keycode) {
switch (keycode) { switch (keycode) {
case Common::KEYCODE_a: case Common::KEYCODE_a:
_currentPos = _promptStartPos; _currentPos = _promptStartPos;
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case Common::KEYCODE_d: case Common::KEYCODE_d:
if (_currentPos < _promptEndPos) { if (_currentPos < _promptEndPos) {
killChar(); killChar();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
case Common::KEYCODE_e: case Common::KEYCODE_e:
_currentPos = _promptEndPos; _currentPos = _promptEndPos;
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case Common::KEYCODE_k: case Common::KEYCODE_k:
killLine(); killLine();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case Common::KEYCODE_w: case Common::KEYCODE_w:
killLastWord(); killLastWord();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
} }
} }
@ -626,7 +626,7 @@ void ConsoleDialog::historyScroll(int direction) {
// Ensure once more the caret is visible (in case of very long history entries) // Ensure once more the caret is visible (in case of very long history entries)
scrollToCurrent(); scrollToCurrent();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void ConsoleDialog::nextLine() { void ConsoleDialog::nextLine() {
@ -704,7 +704,7 @@ void ConsoleDialog::print(const char *str) {
while (*str) while (*str)
printCharIntern(*str++); printCharIntern(*str++);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void ConsoleDialog::drawCaret(bool erase) { void ConsoleDialog::drawCaret(bool erase) {
@ -733,7 +733,7 @@ void ConsoleDialog::scrollToCurrent() {
} else if (line > _scrollLine) { } else if (line > _scrollLine) {
_scrollLine = line; _scrollLine = line;
updateScrollBuffer(); updateScrollBuffer();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }

View file

@ -153,14 +153,6 @@ void Dialog::releaseFocus() {
} }
} }
void Dialog::markAsDirty() {
//TANOKU - FIXME when is this enabled? what does this do?
// Update: called on tab drawing, mainly...
// we can pass this as open a new dialog or something
// g_gui._needRedraw = true;
g_gui._redrawStatus = GUI::GuiManager::kRedrawTopDialog;
}
void Dialog::markWidgetsAsDirty() { void Dialog::markWidgetsAsDirty() {
Widget *w = _firstWidget; Widget *w = _firstWidget;
while (w) { while (w) {

View file

@ -88,7 +88,6 @@ protected:
virtual void open(); virtual void open();
virtual void close(); virtual void close();
void markAsDirty() override;
/** Recursively mark all the widgets in this dialog as dirty so they are redrawn */ /** Recursively mark all the widgets in this dialog as dirty so they are redrawn */
void markWidgetsAsDirty(); void markWidgetsAsDirty();

View file

@ -29,6 +29,7 @@
#include "gui/browser.h" #include "gui/browser.h"
#include "gui/chooser.h" #include "gui/chooser.h"
#include "gui/editgamedialog.h" #include "gui/editgamedialog.h"
#include "gui/gui-manager.h"
#include "gui/launcher.h" #include "gui/launcher.h"
#include "gui/message.h" #include "gui/message.h"
#include "gui/remotebrowser.h" #include "gui/remotebrowser.h"
@ -81,7 +82,7 @@ void DownloadDialog::open() {
if (!selectDirectories()) if (!selectDirectories())
close(); close();
reflowLayout(); reflowLayout();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void DownloadDialog::close() { void DownloadDialog::close() {
@ -101,7 +102,7 @@ void DownloadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
case kDownloadProgressCmd: case kDownloadProgressCmd:
if (!_close) { if (!_close) {
refreshWidgets(); refreshWidgets();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
case kDownloadEndedCmd: case kDownloadEndedCmd:
@ -196,7 +197,7 @@ void DownloadDialog::handleTickle() {
int32 progress = (int32)(100 * CloudMan.getDownloadingProgress()); int32 progress = (int32)(100 * CloudMan.getDownloadingProgress());
if (_progressBar->getValue() != progress) { if (_progressBar->getValue() != progress) {
refreshWidgets(); refreshWidgets();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
Dialog::handleTickle(); Dialog::handleTickle();

View file

@ -28,6 +28,7 @@
#include "common/system.h" #include "common/system.h"
#include "gui/browser.h" #include "gui/browser.h"
#include "gui/gui-manager.h"
#include "gui/message.h" #include "gui/message.h"
#ifdef ENABLE_EVENTRECORDER #ifdef ENABLE_EVENTRECORDER
#include "gui/onscreendialog.h" #include "gui/onscreendialog.h"
@ -424,26 +425,26 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
switch (cmd) { switch (cmd) {
case kCmdGlobalGraphicsOverride: case kCmdGlobalGraphicsOverride:
setGraphicSettingsState(data != 0); setGraphicSettingsState(data != 0);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kCmdGlobalAudioOverride: case kCmdGlobalAudioOverride:
setAudioSettingsState(data != 0); setAudioSettingsState(data != 0);
setSubtitleSettingsState(data != 0); setSubtitleSettingsState(data != 0);
if (_globalVolumeOverride == NULL) if (_globalVolumeOverride == NULL)
setVolumeSettingsState(data != 0); setVolumeSettingsState(data != 0);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kCmdGlobalMIDIOverride: case kCmdGlobalMIDIOverride:
setMIDISettingsState(data != 0); setMIDISettingsState(data != 0);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kCmdGlobalMT32Override: case kCmdGlobalMT32Override:
setMT32SettingsState(data != 0); setMT32SettingsState(data != 0);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kCmdGlobalVolumeOverride: case kCmdGlobalVolumeOverride:
setVolumeSettingsState(data != 0); setVolumeSettingsState(data != 0);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kCmdChooseSoundFontCmd: case kCmdChooseSoundFontCmd:
{ {
@ -459,7 +460,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
else else
_soundFontClearButton->setEnabled(false); _soundFontClearButton->setEnabled(false);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -477,9 +478,9 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// FSList files = dir.listDir(FSNode::kListFilesOnly); // FSList files = dir.listDir(FSNode::kListFilesOnly);
_gamePathWidget->setLabel(dir.getPath()); _gamePathWidget->setLabel(dir.getPath());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
} }
@ -491,9 +492,9 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// User made his choice... // User made his choice...
Common::FSNode dir(browser.getResult()); Common::FSNode dir(browser.getResult());
_extraPathWidget->setLabel(dir.getPath()); _extraPathWidget->setLabel(dir.getPath());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
} }
// Change path for stored save game (perm and temp) data // Change path for stored save game (perm and temp) data
@ -508,9 +509,9 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
MessageDialog warningMessage(_("Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory.")); MessageDialog warningMessage(_("Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory."));
warningMessage.runModal(); warningMessage.runModal();
#endif #endif
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
} }

View file

@ -30,6 +30,7 @@
#include "common/translation.h" #include "common/translation.h"
#include "gui/widgets/list.h" #include "gui/widgets/list.h"
#include "gui/gui-manager.h"
#include "gui/message.h" #include "gui/message.h"
namespace GUI { namespace GUI {
@ -154,7 +155,7 @@ void FileBrowserDialog::updateListing() {
_fileList->scrollTo(0); _fileList->scrollTo(0);
// Finally, redraw // Finally, redraw
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} // End of namespace GUI } // End of namespace GUI

View file

@ -21,6 +21,7 @@
*/ */
#include "gui/fluidsynth-dialog.h" #include "gui/fluidsynth-dialog.h"
#include "gui/gui-manager.h"
#include "gui/message.h" #include "gui/message.h"
#include "gui/widgets/tab.h" #include "gui/widgets/tab.h"
#include "gui/widgets/popup.h" #include "gui/widgets/popup.h"
@ -218,7 +219,7 @@ void FluidSynthSettingsDialog::handleCommand(CommandSender *sender, uint32 cmd,
if (alert.runModal() == GUI::kMessageOK) { if (alert.runModal() == GUI::kMessageOK) {
resetSettings(); resetSettings();
readSettings(); readSettings();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }

View file

@ -590,8 +590,8 @@ void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDi
} }
} }
void GuiManager::doFullRedraw() { void GuiManager::scheduleTopDialogRedraw() {
_redrawStatus = kRedrawFull; _redrawStatus = kRedrawTopDialog;
} }
void GuiManager::giveFocusToDialog(Dialog *dialog) { void GuiManager::giveFocusToDialog(Dialog *dialog) {

View file

@ -75,7 +75,7 @@ public:
void runLoop(); void runLoop();
void processEvent(const Common::Event &event, Dialog *const activeDialog); void processEvent(const Common::Event &event, Dialog *const activeDialog);
void doFullRedraw(); void scheduleTopDialogRedraw();
bool isActive() const { return ! _dialogStack.empty(); } bool isActive() const { return ! _dialogStack.empty(); }

View file

@ -323,7 +323,7 @@ void LauncherDialog::addGame() {
selectTarget(newTarget); selectTarget(newTarget);
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
// We need to update the buttons here, so "Mass add" will revert to "Add game" // We need to update the buttons here, so "Mass add" will revert to "Add game"
@ -427,7 +427,7 @@ void LauncherDialog::removeGame(int item) {
// Update the ListWidget and force a redraw // Update the ListWidget and force a redraw
updateListing(); updateListing();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }
@ -452,7 +452,7 @@ void LauncherDialog::editGame(int item) {
// Update the ListWidget, reselect the edited game and force a redraw // Update the ListWidget, reselect the edited game and force a redraw
updateListing(); updateListing();
selectTarget(editDialog.getDomain()); selectTarget(editDialog.getDomain());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }
@ -614,7 +614,7 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
// Update the ListWidget, select the new item, and force a redraw // Update the ListWidget, select the new item, and force a redraw
updateListing(); updateListing();
selectTarget(editDialog.getDomain()); selectTarget(editDialog.getDomain());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} else { } else {
// User aborted, remove the the new domain again // User aborted, remove the the new domain again
ConfMan.removeGameDomain(domain); ConfMan.removeGameDomain(domain);

View file

@ -87,8 +87,6 @@ public:
virtual bool isVisible() const = 0; virtual bool isVisible() const = 0;
virtual void markAsDirty() = 0;
virtual void reflowLayout(); virtual void reflowLayout();
virtual void removeWidget(Widget *widget); virtual void removeWidget(Widget *widget);

View file

@ -773,7 +773,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
case kClearSoundFontCmd: case kClearSoundFontCmd:
_soundFont->setLabel(_c("None", "soundfont")); _soundFont->setLabel(_c("None", "soundfont"));
_soundFontClearButton->setEnabled(false); _soundFontClearButton->setEnabled(false);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kKbdMouseSpeedChanged: case kKbdMouseSpeedChanged:
_kbdMouseSpeedLabel->setLabel(_(kbdMouseSpeedLabels[_kbdMouseSpeedSlider->getValue()])); _kbdMouseSpeedLabel->setLabel(_(kbdMouseSpeedLabels[_kbdMouseSpeedSlider->getValue()]));
@ -1936,7 +1936,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
error.runModal(); error.runModal();
return; return;
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -1946,7 +1946,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
// User made his choice... // User made his choice...
Common::FSNode dir(browser.getResult()); Common::FSNode dir(browser.getResult());
_themePath->setLabel(dir.getPath()); _themePath->setLabel(dir.getPath());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -1956,7 +1956,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
// User made his choice... // User made his choice...
Common::FSNode dir(browser.getResult()); Common::FSNode dir(browser.getResult());
_extraPath->setLabel(dir.getPath()); _extraPath->setLabel(dir.getPath());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -1967,7 +1967,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
// User made his choice... // User made his choice...
Common::FSNode dir(browser.getResult()); Common::FSNode dir(browser.getResult());
_pluginsPath->setLabel(dir.getPath()); _pluginsPath->setLabel(dir.getPath());
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -1982,7 +1982,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (path.empty()) if (path.empty())
path = "/"; // absolute root path = "/"; // absolute root
_rootPath->setLabel(path); _rootPath->setLabel(path);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -2013,7 +2013,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
else else
_soundFontClearButton->setEnabled(false); _soundFontClearButton->setEnabled(false);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }
@ -2107,7 +2107,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (_serverPort) { if (_serverPort) {
_serverPort->setEditString(Common::String::format("%u", Networking::LocalWebserver::DEFAULT_SERVER_PORT)); _serverPort->setEditString(Common::String::format("%u", Networking::LocalWebserver::DEFAULT_SERVER_PORT));
} }
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
} }
#endif // USE_SDL_NET #endif // USE_SDL_NET
@ -2144,7 +2144,7 @@ void GlobalOptionsDialog::handleTickle() {
#endif #endif
if (_redrawCloudTab) { if (_redrawCloudTab) {
setupCloudTab(); setupCloudTab();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
_redrawCloudTab = false; _redrawCloudTab = false;
} }
#endif #endif

View file

@ -21,6 +21,7 @@
*/ */
#include "gui/remotebrowser.h" #include "gui/remotebrowser.h"
#include "gui/gui-manager.h"
#include "gui/widgets/list.h" #include "gui/widgets/list.h"
#include "common/config-manager.h" #include "common/config-manager.h"
@ -28,9 +29,9 @@
#include "common/algorithm.h" #include "common/algorithm.h"
#include "common/translation.h" #include "common/translation.h"
#include <backends/networking/curl/request.h> #include "backends/networking/curl/request.h"
#include <backends/cloud/storage.h> #include "backends/cloud/storage.h"
#include <backends/cloud/cloudmanager.h> #include "backends/cloud/cloudmanager.h"
#include "message.h" #include "message.h"
namespace GUI { namespace GUI {
@ -162,7 +163,7 @@ void RemoteBrowserDialog::updateListing() {
_fileList->setEnabled(!_navigationLocked); _fileList->setEnabled(!_navigationLocked);
// Finally, redraw // Finally, redraw
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void RemoteBrowserDialog::goUp() { void RemoteBrowserDialog::goUp() {

View file

@ -60,7 +60,7 @@ SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(bool canRunInBa
new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog
ButtonWidget *backgroundButton = new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog ButtonWidget *backgroundButton = new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog
backgroundButton->setEnabled(canRunInBackground); backgroundButton->setEnabled(canRunInBackground);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
SaveLoadCloudSyncProgressDialog::~SaveLoadCloudSyncProgressDialog() { SaveLoadCloudSyncProgressDialog::~SaveLoadCloudSyncProgressDialog() {
@ -601,7 +601,7 @@ void SaveLoadChooserSimple::updateSelection(bool redraw) {
_chooseButton->markAsDirty(); _chooseButton->markAsDirty();
_deleteButton->markAsDirty(); _deleteButton->markAsDirty();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }
@ -703,7 +703,7 @@ void SaveLoadChooserSimple::updateSaveList() {
else else
_chooseButton->setEnabled(false); _chooseButton->setEnabled(false);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
// SaveLoadChooserGrid implementation // SaveLoadChooserGrid implementation
@ -761,13 +761,13 @@ void SaveLoadChooserGrid::handleCommand(CommandSender *sender, uint32 cmd, uint3
case kNextCmd: case kNextCmd:
++_curPage; ++_curPage;
updateSaves(); updateSaves();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kPrevCmd: case kPrevCmd:
--_curPage; --_curPage;
updateSaves(); updateSaves();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
break; break;
case kNewSaveCmd: case kNewSaveCmd:
@ -788,13 +788,13 @@ void SaveLoadChooserGrid::handleMouseWheel(int x, int y, int direction) {
if (_nextButton->isEnabled()) { if (_nextButton->isEnabled()) {
++_curPage; ++_curPage;
updateSaves(); updateSaves();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} else { } else {
if (_prevButton->isEnabled()) { if (_prevButton->isEnabled()) {
--_curPage; --_curPage;
updateSaves(); updateSaves();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }
} }
@ -802,7 +802,7 @@ void SaveLoadChooserGrid::handleMouseWheel(int x, int y, int direction) {
void SaveLoadChooserGrid::updateSaveList() { void SaveLoadChooserGrid::updateSaveList() {
SaveLoadChooserDialog::updateSaveList(); SaveLoadChooserDialog::updateSaveList();
updateSaves(); updateSaves();
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void SaveLoadChooserGrid::open() { void SaveLoadChooserGrid::open() {

View file

@ -231,7 +231,7 @@ void StorageWizardDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
_codeWidget[i]->setEditString(subcode); _codeWidget[i]->setEditString(subcode);
} }
handleCommand(sender, kCodeBoxCmd, data); handleCommand(sender, kCodeBoxCmd, data);
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
break; break;
} }

View file

@ -115,7 +115,7 @@ void ThemeBrowser::updateListing() {
_fileList->setSelected(currentThemeIndex); _fileList->setSelected(currentThemeIndex);
// Finally, redraw // Finally, redraw
markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} // End of namespace GUI } // End of namespace GUI

View file

@ -206,7 +206,7 @@ void Widget::setEnabled(bool e) {
else else
clearFlags(WIDGET_ENABLED); clearFlags(WIDGET_ENABLED);
_boss->markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }

View file

@ -744,7 +744,7 @@ void ListWidget::setFilter(const String &filter, bool redraw) {
// Such a widget could also (optionally) draw a border (or even different // Such a widget could also (optionally) draw a border (or even different
// kinds of borders) around the objects it groups; and also a 'title' // kinds of borders) around the objects it groups; and also a 'title'
// (I am borrowing these "ideas" from the NSBox class in Cocoa :). // (I am borrowing these "ideas" from the NSBox class in Cocoa :).
_boss->markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }

View file

@ -102,7 +102,7 @@ void ScrollContainerWidget::handleCommand(CommandSender *sender, uint32 cmd, uin
case kSetPositionCmd: case kSetPositionCmd:
_scrolledY = _verticalScroll->_currentPos; _scrolledY = _verticalScroll->_currentPos;
reflowLayout(); reflowLayout();
g_gui.doFullRedraw(); g_gui.scheduleTopDialogRedraw();
break; break;
} }
} }

View file

@ -154,7 +154,7 @@ void TabWidget::removeTab(int tabID) {
} }
// Finally trigger a redraw // Finally trigger a redraw
_boss->markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
void TabWidget::setActiveTab(int tabID) { void TabWidget::setActiveTab(int tabID) {
@ -174,7 +174,7 @@ void TabWidget::setActiveTab(int tabID) {
while (_lastVisibleTab < tabID) while (_lastVisibleTab < tabID)
setFirstVisible(_firstVisibleTab + 1, false); setFirstVisible(_firstVisibleTab + 1, false);
_boss->markAsDirty(); g_gui.scheduleTopDialogRedraw();
} }
} }
@ -246,7 +246,7 @@ void TabWidget::setFirstVisible(int tabID, bool adjustIfRoom) {
computeLastVisibleTab(adjustIfRoom); computeLastVisibleTab(adjustIfRoom);
_boss->markAsDirty(); // TODO: Necessary? g_gui.scheduleTopDialogRedraw(); // TODO: Necessary?
} }
void TabWidget::reflowLayout() { void TabWidget::reflowLayout() {