ENH: [STUDIO-3911] load as model file when drag to home page

Change-Id: I1d8986ca4984fea418371f253a48a9593bb9b1af
(cherry picked from commit 685edaa145cd4b4ce4afce00ae81d78305f84e84)
This commit is contained in:
chunmao.guo 2023-08-09 14:44:14 +08:00 committed by Lane.Wei
parent dee1c04f28
commit d30470d603
1 changed files with 6 additions and 0 deletions

View File

@ -528,6 +528,12 @@ void WebViewPanel::OnNavigationRequest(wxWebViewEvent& evt)
const wxString &url = evt.GetURL();
if (url.StartsWith("File://") || url.StartsWith("file://")) {
if (!url.Contains("/web/homepage/index.html")) {
auto file = wxURL::Unescape(wxURL(url).GetPath());
#ifdef _WIN32
if (file.StartsWith('/'))
file = file.Mid(1);
#endif
wxGetApp().plater()->load_files(wxArrayString{1, &file});
evt.Veto();
return;
}