diff options
-rw-r--r-- | gui/gui-manager.cpp | 2 | ||||
-rw-r--r-- | gui/saveload-dialog.cpp | 43 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 32 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_lowres.stx | 32 |
4 files changed, 71 insertions, 38 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 9acd9434ff..9d68d76c9c 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -216,7 +216,7 @@ void GuiManager::redraw() { // Tanoku: Do not apply shading more than once when opening many dialogs // on top of each other. Screen ends up being too dark and it's a // performance hog. - if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 2) + if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 3) shading = ThemeEngine::kShadingNone; switch (_redrawStatus) { diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index af4db178a9..e9248bd082 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -44,47 +44,16 @@ enum { kBackgroundSyncCmd = 'PDBS' }; -SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(): Dialog(0,0,0,0), _close(false) { - const int screenW = g_system->getOverlayWidth(); - const int screenH = g_system->getOverlayHeight(); - - int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0) * 1.4; // "Run in background" is too long - int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0); - int progressBarHeight = buttonHeight; - - int marginAround = 8; - int marginBottom = 8; - int marginBetween = 10; - - _w = screenW * 80 / 100; - _h = 0; - _h += buttonHeight + marginBottom; //buttons - _h += 2 * (kLineHeight + 2 * marginAround); //top label + bottom label - _h += progressBarHeight; //progress bar - if (_h > screenH) _h = screenH; - - // Center the dialog - _x = (screenW - _w) / 2; - _y = (screenH - _h) / 2; - - _label = new StaticTextWidget(this, marginAround, marginAround, _w - marginAround * 2, kLineHeight, "Downloading saves...", Graphics::kTextAlignCenter); - +SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(): Dialog("SaveLoadCloudSyncProgress"), _close(false) { + _label = new StaticTextWidget(this, "SaveLoadCloudSyncProgress.TitleText", "Downloading saves..."); uint32 progress = (uint32)(100 * CloudMan.getSyncDownloadingProgress()); - _progressBar = new SliderWidget(this, marginAround, marginAround * 2 + kLineHeight, _w - marginAround * 2, progressBarHeight); + _progressBar = new SliderWidget(this, "SaveLoadCloudSyncProgress.ProgressBar"); _progressBar->setMinValue(0); _progressBar->setMaxValue(100); _progressBar->setValue(progress); - - _percentLabel = new StaticTextWidget(this, marginAround, marginAround * 3 + kLineHeight + progressBarHeight, _w - marginAround * 2, kLineHeight, Common::String::format("%u %%", progress), Graphics::kTextAlignCenter); - - int x1 = (_w - buttonWidth * 2 - marginBetween) / 2; - int x2 = x1 + buttonWidth + marginBetween; - - //if (defaultButton) - new ButtonWidget(this, x1, _h - buttonHeight - marginBottom, buttonWidth, buttonHeight, "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog - - //if (altButton) - new ButtonWidget(this, x2, _h - buttonHeight - marginBottom, buttonWidth, buttonHeight, "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog + _percentLabel = new StaticTextWidget(this, "SaveLoadCloudSyncProgress.PercentText", Common::String::format("%u %%", progress)); + new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog + new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog } SaveLoadCloudSyncProgressDialog::~SaveLoadCloudSyncProgressDialog() {} diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 026fa7bc64..f14e447535 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -1056,6 +1056,38 @@ </layout> </dialog> + <dialog name = 'SaveLoadCloudSyncProgress' overlays = 'screen_center' inset = '8' shading = 'dim'> + <layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'> + <widget name = 'TitleText' + width = '496' + height = 'Globals.Line.Height' + textalign = 'center' + /> + <space size = '1'/> + <widget name = 'ProgressBar' + width = '496' + height = 'Globals.Button.Height' + /> + <space size = '1'/> + <widget name = 'PercentText' + width = '496' + height = 'Globals.Line.Height' + textalign = 'center' + /> + <space size = '1'/> + <layout type = 'horizontal' padding = '0, 0, 0, 0' center = 'true' spacing = '10'> + <widget name = 'Cancel' + width = '150' + height = 'Globals.Button.Height' + /> + <widget name = 'Background' + width = '150' + height = 'Globals.Button.Height' + /> + </layout> + </layout> + </dialog> + <dialog name = 'SavenameDialog' overlays = 'screen_center'> <layout type = 'vertical' padding = '8, 8, 8, 8'> <widget name = 'DescriptionText' diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 169e61a9bb..7c2326d5de 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -1038,6 +1038,38 @@ </layout> </dialog> + <dialog name = 'SaveLoadCloudSyncProgress' overlays = 'screen_center' inset = '8' shading = 'dim'> + <layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'> + <widget name = 'TitleText' + width = '240' + height = 'Globals.Line.Height' + textalign = 'center' + /> + <space size = '1'/> + <widget name = 'ProgressBar' + width = '240' + height = 'Globals.Button.Height' + /> + <space size = '1'/> + <widget name = 'PercentText' + width = '240' + height = 'Globals.Line.Height' + textalign = 'center' + /> + <space size = '1'/> + <layout type = 'horizontal' padding = '0, 0, 0, 0' center = 'true' spacing = '10'> + <widget name = 'Cancel' + width = '100' + height = 'Globals.Button.Height' + /> + <widget name = 'Background' + width = '100' + height = 'Globals.Button.Height' + /> + </layout> + </layout> + </dialog> + <dialog name = 'SavenameDialog' overlays = 'screen_center'> <layout type = 'vertical' padding = '8, 8, 8, 8'> <widget name = 'DescriptionText' |