mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
ENH: webview dark mode
Change-Id: I0b58e759268d057d5942dd8726c37d1abbdd5930
This commit is contained in:
parent
65ee16f676
commit
bf24a71b60
7 changed files with 87 additions and 10 deletions
|
@ -35,7 +35,6 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
|
|||
std::string strlang = wxGetApp().app_config->get("language");
|
||||
if (strlang != "")
|
||||
url = wxString::Format("file://%s/web/homepage/index.html?lang=%s", from_u8(resources_dir()), strlang);
|
||||
m_bbl_user_agent = wxString::Format("BBL-Slicer/v%s", SLIC3R_VERSION);
|
||||
|
||||
wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
@ -87,6 +86,18 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
|
|||
|
||||
topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
||||
|
||||
Bind(EVT_WEBVIEW_RECREATED, [this](auto &evt) {
|
||||
#ifdef __WXMSW__
|
||||
m_browser = dynamic_cast<wxWebView *>(evt.GetEventObject());
|
||||
if (m_browser == nullptr) {
|
||||
wxLogError("Could not recreate browser");
|
||||
return;
|
||||
}
|
||||
GetSizer()->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
||||
GetSizer()->Layout();
|
||||
#endif
|
||||
});
|
||||
|
||||
// Log backend information
|
||||
if (wxGetApp().get_mode() == comDevelop) {
|
||||
wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
||||
|
@ -95,7 +106,6 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
|
|||
wxLogMessage("User Agent: %s", m_browser->GetUserAgent());
|
||||
}
|
||||
|
||||
|
||||
// Create the Tools menu
|
||||
m_tools_menu = new wxMenu();
|
||||
wxMenuItem* viewSource = m_tools_menu->Append(wxID_ANY, _L("View Source"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue