FIX: web view log

Change-Id: I8e28d7b8f5cfbc95428a3768b32f312a591e41c1
(cherry picked from commit fe623cb52a449ff7dffb10c9de8d7af9c7651f1e)
This commit is contained in:
chunmao.guo 2022-07-27 16:55:55 +08:00 committed by Lane.Wei
parent 1a8e5295b2
commit cc1fb36a22
3 changed files with 5 additions and 2 deletions

View file

@ -230,7 +230,7 @@ void wxMediaCtrl2::DoSetSize(int x, int y, int width, int height, int sizeFlags)
size = wxSize{16, 9};
int maxHeight = (width * size.GetHeight() + size.GetHeight() - 1) / size.GetWidth();
if (maxHeight != GetMaxHeight()) {
BOOST_LOG_TRIVIAL(info) << "wxMediaCtrl2::DoSetSize: width: " << width << ", height: " << height << ", maxHeight: " << maxHeight;
// BOOST_LOG_TRIVIAL(info) << "wxMediaCtrl2::DoSetSize: width: " << width << ", height: " << height << ", maxHeight: " << maxHeight;
SetMaxSize({-1, maxHeight});
Slic3r::GUI::wxGetApp().CallAfter([this] {
if (auto p = GetParent()) {

View file

@ -48,7 +48,7 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
wxString TargetUrl = SetStartPage(BBL_WELCOME, false);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", set start page to welcome ") << TargetUrl;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", set start page to welcome ");
// Create the webview
m_browser = WebView::CreateWebView(this, TargetUrl);

View file

@ -65,6 +65,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
url2.Replace("\\", "/");
#endif
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << url2.ToUTF8();
auto webView = wxWebView::New();
if (webView) {
@ -93,6 +94,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
#endif
webView->EnableContextMenu(false);
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": failed. Use fake web view.";
webView = new FakeWebView;
}
return webView;
@ -105,6 +107,7 @@ void WebView::LoadUrl(wxWebView * webView, wxString const &url)
url2.Replace("\\", "/");
#endif
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << url2.ToUTF8();
webView->LoadURL(url2);
}