diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index ad89461ff..c8de421bc 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -311,7 +311,7 @@ void TextureAtlasEditor::fileMenuClick( const Event* Event ) { [this]( auto event ) { onTextureAtlasClose( event ); } ); MsgBox->setTitle( "Close Texture Atlas?" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); } else { onTextureAtlasClose( NULL ); } diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index e349b9d60..cb1711fc7 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -254,13 +254,13 @@ void TextureAtlasNew::onSelectFolder( const Event* Event ) { "The folder must contain at least one image!" ); MsgBox->setTitle( "Error" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); } } else { MsgBox = UIMessageBox::New( UIMessageBox::OK, "You must select a folder!" ); MsgBox->setTitle( "Error" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); } } diff --git a/src/eepp/ui/tools/uicodeeditorsplitter.cpp b/src/eepp/ui/tools/uicodeeditorsplitter.cpp index afe618bf3..26c052dd9 100644 --- a/src/eepp/ui/tools/uicodeeditorsplitter.cpp +++ b/src/eepp/ui/tools/uicodeeditorsplitter.cpp @@ -1051,7 +1051,7 @@ bool UICodeEditorSplitter::tryCodeEditorClose( UICodeEditor* editor, mTryCloseMsgBox->setTitle( editor->getUISceneNode()->i18n( "ask_close_tab", "Close Tab?" ) ); mTryCloseMsgBox->center(); - mTryCloseMsgBox->show(); + mTryCloseMsgBox->showWhenReady(); return false; } diff --git a/src/eepp/ui/uifiledialog.cpp b/src/eepp/ui/uifiledialog.cpp index c8f72c082..0f47368d3 100644 --- a/src/eepp/ui/uifiledialog.cpp +++ b/src/eepp/ui/uifiledialog.cpp @@ -131,7 +131,6 @@ UIFileDialog::UIFileDialog( Uint32 dialogFlags, const std::string& defaultFilePa "Enter new folder name:" ) ); msgBox->setTitle( i18n( "uifiledialog_create_new_folder", "Create new folder" ) ); msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } ); - msgBox->show(); msgBox->on( Event::OnConfirm, [this, msgBox]( const Event* ) { auto folderName( msgBox->getTextInput()->getText() ); auto newFolderPath( getCurPath() + folderName ); @@ -147,6 +146,7 @@ UIFileDialog::UIFileDialog( Uint32 dialogFlags, const std::string& defaultFilePa msgBox->closeWindow(); } ); + msgBox->showWhenReady(); } } ); diff --git a/src/modules/maps/src/eepp/maps/mapeditor/mapeditor.cpp b/src/modules/maps/src/eepp/maps/mapeditor/mapeditor.cpp index 8727c593e..8f4cacb21 100644 --- a/src/modules/maps/src/eepp/maps/mapeditor/mapeditor.cpp +++ b/src/modules/maps/src/eepp/maps/mapeditor/mapeditor.cpp @@ -1167,7 +1167,7 @@ void MapEditor::fileMenuClick( const Event* Event ) { MsgBox->addEventListener( Event::OnConfirm, [this]( auto event ) { onMapClose( event ); } ); MsgBox->setTitle( "Close Map?" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); } else if ( "Quit" == txt ) { if ( NULL == mUIWindow ) { mUIContainer->getSceneNode()->getWindow()->close(); @@ -1339,7 +1339,7 @@ UIMessageBox* MapEditor::createAlert( const String& title, const String& text ) MsgBox->setWindowFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_RESIZEABLE | UI_WIN_MODAL ); MsgBox->setTitle( title ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); return MsgBox; } diff --git a/src/tests/test_all/test.cpp b/src/tests/test_all/test.cpp index 75b7a912d..e8682ba20 100644 --- a/src/tests/test_all/test.cpp +++ b/src/tests/test_all/test.cpp @@ -1039,7 +1039,7 @@ void EETest::createColorPicker( Node* node ) { mColorPicker = Tools::UIColorPicker::NewModal( node, []( Color color ) { UIMessageBox* msgBox = UIMessageBox::New( UIMessageBox::OK, color.toHexString() ); msgBox->center(); - msgBox->show(); + msgBox->showWhenReady(); } ); // mColorPicker->getUIWindow()->center(); } diff --git a/src/tools/mapeditor/mapeditor.cpp b/src/tools/mapeditor/mapeditor.cpp index 5b6f22e8f..4123775d6 100644 --- a/src/tools/mapeditor/mapeditor.cpp +++ b/src/tools/mapeditor/mapeditor.cpp @@ -30,7 +30,7 @@ bool onCloseRequestCallback( EE::Window::Window* ) { MsgBox->addEventListener( Event::OnClose, []( const Event* ) { MsgBox = NULL; } ); MsgBox->setTitle( "Close Map?" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); return false; } else { return true; diff --git a/src/tools/textureatlaseditor/textureatlaseditor.cpp b/src/tools/textureatlaseditor/textureatlaseditor.cpp index 9ad0d1a14..bcd6337b8 100644 --- a/src/tools/textureatlaseditor/textureatlaseditor.cpp +++ b/src/tools/textureatlaseditor/textureatlaseditor.cpp @@ -30,7 +30,7 @@ bool onCloseRequestCallback( EE::Window::Window* ) { MsgBox->addEventListener( Event::OnClose, []( const Event* ) { MsgBox = NULL; } ); MsgBox->setTitle( "Close Texture Atlas Editor?" ); MsgBox->center(); - MsgBox->show(); + MsgBox->showWhenReady(); return false; } else { return true; diff --git a/src/tools/uieditor/uieditor.cpp b/src/tools/uieditor/uieditor.cpp index 18ae95f70..ea4a64a94 100644 --- a/src/tools/uieditor/uieditor.cpp +++ b/src/tools/uieditor/uieditor.cpp @@ -878,7 +878,7 @@ bool App::onCloseRequestCallback( EE::Window::Window* ) { mMsgBox->addEventListener( Event::OnWindowClose, [this]( const Event* ) { mMsgBox = NULL; } ); mMsgBox->setTitle( "Close Editor?" ); mMsgBox->center(); - mMsgBox->show(); + mMsgBox->showWhenReady(); SceneManager::instance()->setCurrentUISceneNode( mUISceneNode ); return false;