From 90275620d66ee3e53d133aed8009cd5329804375 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Thu, 8 Dec 2022 16:07:04 +0800 Subject: [PATCH] FIX: [STUDIO-1614] hide home webview before loaded Change-Id: I5182e3058575c3e542813b3c380fe6dcfd11c037 (cherry picked from commit e4684cf43ee0cd11beb2cc6dea35900218d0ca98) --- src/slic3r/GUI/MediaPlayCtrl.cpp | 2 -- src/slic3r/GUI/WebViewDialog.cpp | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 772c516648..9f25f62c1d 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -65,8 +65,6 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w m_lan_user = "bblp"; m_lan_passwd = "bblp"; - - wxGetApp().UpdateDarkUIWin(this); } MediaPlayCtrl::~MediaPlayCtrl() diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index ef8a2ebc83..04f709cd52 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -37,7 +37,6 @@ WebViewPanel::WebViewPanel(wxWindow *parent) url = wxString::Format("file://%s/web/homepage/index.html?lang=%s", from_u8(resources_dir()), strlang); wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL); - #if !BBL_RELEASE_TO_PUBLIC // Create the button @@ -64,12 +63,13 @@ WebViewPanel::WebViewPanel(wxWindow *parent) m_button_tools = new wxButton(this, wxID_ANY, wxT("Tools"), wxDefaultPosition, wxDefaultSize, 0); bSizer_toolbar->Add(m_button_tools, 0, wxALL, 5); + topsizer->Add(bSizer_toolbar, 0, wxEXPAND, 0); + bSizer_toolbar->Show(false); + // Create panel for find toolbar. wxPanel* panel = new wxPanel(this); - topsizer->Add(bSizer_toolbar, 0, wxEXPAND, 0); topsizer->Add(panel, wxSizerFlags().Expand()); - // Create sizer for panel. wxBoxSizer* panel_sizer = new wxBoxSizer(wxVERTICAL); panel->SetSizer(panel_sizer); @@ -77,14 +77,13 @@ WebViewPanel::WebViewPanel(wxWindow *parent) // Create the info panel m_info = new wxInfoBar(this); topsizer->Add(m_info, wxSizerFlags().Expand()); - // Create the webview m_browser = WebView::CreateWebView(this, url); if (m_browser == nullptr) { wxLogError("Could not init m_browser"); return; } - + m_browser->Hide(); SetSizer(topsizer); topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1)); @@ -305,7 +304,6 @@ void WebViewPanel::OnIdle(wxIdleEvent& WXUNUSED(evt)) m_button_stop->Enable(false); } #endif //BBL_RELEASE_TO_PUBLIC - } /** @@ -522,6 +520,8 @@ void WebViewPanel::OnNavigationRequest(wxWebViewEvent& evt) */ void WebViewPanel::OnNavigationComplete(wxWebViewEvent& evt) { + m_browser->Show(); + Layout(); BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": " << evt.GetTarget().ToUTF8().data(); if (wxGetApp().get_mode() == comDevelop) wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'");