mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: web view log
Change-Id: I8e28d7b8f5cfbc95428a3768b32f312a591e41c1 (cherry picked from commit fe623cb52a449ff7dffb10c9de8d7af9c7651f1e)
This commit is contained in:
parent
1a8e5295b2
commit
cc1fb36a22
3 changed files with 5 additions and 2 deletions
|
@ -230,7 +230,7 @@ void wxMediaCtrl2::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
size = wxSize{16, 9};
|
size = wxSize{16, 9};
|
||||||
int maxHeight = (width * size.GetHeight() + size.GetHeight() - 1) / size.GetWidth();
|
int maxHeight = (width * size.GetHeight() + size.GetHeight() - 1) / size.GetWidth();
|
||||||
if (maxHeight != GetMaxHeight()) {
|
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});
|
SetMaxSize({-1, maxHeight});
|
||||||
Slic3r::GUI::wxGetApp().CallAfter([this] {
|
Slic3r::GUI::wxGetApp().CallAfter([this] {
|
||||||
if (auto p = GetParent()) {
|
if (auto p = GetParent()) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
|
||||||
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
wxString TargetUrl = SetStartPage(BBL_WELCOME, false);
|
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
|
// Create the webview
|
||||||
m_browser = WebView::CreateWebView(this, TargetUrl);
|
m_browser = WebView::CreateWebView(this, TargetUrl);
|
||||||
|
|
|
@ -65,6 +65,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||||
url2.Replace("\\", "/");
|
url2.Replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
|
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << url2.ToUTF8();
|
||||||
|
|
||||||
auto webView = wxWebView::New();
|
auto webView = wxWebView::New();
|
||||||
if (webView) {
|
if (webView) {
|
||||||
|
@ -93,6 +94,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||||
#endif
|
#endif
|
||||||
webView->EnableContextMenu(false);
|
webView->EnableContextMenu(false);
|
||||||
} else {
|
} else {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": failed. Use fake web view.";
|
||||||
webView = new FakeWebView;
|
webView = new FakeWebView;
|
||||||
}
|
}
|
||||||
return webView;
|
return webView;
|
||||||
|
@ -105,6 +107,7 @@ void WebView::LoadUrl(wxWebView * webView, wxString const &url)
|
||||||
url2.Replace("\\", "/");
|
url2.Replace("\\", "/");
|
||||||
#endif
|
#endif
|
||||||
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
|
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << url2.ToUTF8();
|
||||||
webView->LoadURL(url2);
|
webView->LoadURL(url2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue