From d4907f0e4f00947585bbc3a95b1f6675c9d3fddb Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Mon, 20 Mar 2023 19:40:50 +0800 Subject: [PATCH] ENH: Optimize Dialog Positon Again 2 Change-Id: I3f2af3ee696415d07fc926596e110d5874dc579c (cherry picked from commit 73baa282ab7a98df9cde95703da096c6a02eac61) --- src/slic3r/GUI/WebGuideDialog.cpp | 3 ++- src/slic3r/GUI/WebUserLoginDialog.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 0006c0bef..ae2b3ad30 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -78,7 +78,8 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style) int screenheight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, NULL); int screenwidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, NULL); int MaxY = (screenheight - pSize.y) > 0 ? (screenheight - pSize.y) / 2 : 0; - MoveWindow(this->m_hWnd, (screenwidth - pSize.x) / 2, MaxY, pSize.x, pSize.y, TRUE); + wxPoint tmpPT((screenwidth - pSize.x) / 2, MaxY); + Move(tmpPT); #ifdef __WXMSW__ this->Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) { if ((m_page == BBL_FILAMENT_ONLY || m_page == BBL_MODELS_ONLY) && e.GetKeyCode() == WXK_ESCAPE) { diff --git a/src/slic3r/GUI/WebUserLoginDialog.cpp b/src/slic3r/GUI/WebUserLoginDialog.cpp index 9162ac1ea..301fe5139 100644 --- a/src/slic3r/GUI/WebUserLoginDialog.cpp +++ b/src/slic3r/GUI/WebUserLoginDialog.cpp @@ -112,7 +112,8 @@ ZUserLogin::ZUserLogin() : wxDialog((wxWindow *) (wxGetApp().mainframe), wxID_AN int screenheight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, NULL); int screenwidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, NULL); int MaxY = (screenheight - pSize.y) > 0 ? (screenheight - pSize.y) / 2 : 0; - MoveWindow(this->m_hWnd, (screenwidth - pSize.x) / 2, MaxY, pSize.x, pSize.y, TRUE); + wxPoint tmpPT((screenwidth - pSize.x) / 2, MaxY); + Move(tmpPT); //Param m_AutotestToken = "";