From 31667d04b0320985751679af6d410c4e68726be3 Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Mon, 20 Mar 2023 16:12:35 +0800 Subject: [PATCH] ENH: Optimize Dialog Position Change-Id: I6795d6d0f979ff379b8c4f1f010eeaba6aa339b1 (cherry picked from commit 2ce1e9a9f3141bc2149a4d1f62656f1a3d57b26e) --- src/slic3r/GUI/WebGuideDialog.cpp | 9 ++++----- src/slic3r/GUI/WebUserLoginDialog.cpp | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 1ae709bcc..0006c0bef 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -75,11 +75,10 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style) wxSize pSize = FromDIP(wxSize(820, 660)); SetSize(pSize); - CenterOnParent(); - //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); + 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); #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 1c324b8d3..9162ac1ea 100644 --- a/src/slic3r/GUI/WebUserLoginDialog.cpp +++ b/src/slic3r/GUI/WebUserLoginDialog.cpp @@ -109,7 +109,10 @@ ZUserLogin::ZUserLogin() : wxDialog((wxWindow *) (wxGetApp().mainframe), wxID_AN wxSize pSize = FromDIP(wxSize(650, 840)); SetSize(pSize); - CenterOnParent(); + 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); //Param m_AutotestToken = "";