mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 06:50:41 +08:00
Runscript only if tab with webview is shown.
Fixes premature script running on sys_color_changed. This can be solved more elegantly.
This commit is contained in:
parent
b05d438fc6
commit
7bc73be0c9
@ -168,6 +168,7 @@ void WebViewPanel::load_error_page()
|
||||
|
||||
void WebViewPanel::on_show(wxShowEvent& evt)
|
||||
{
|
||||
m_shown = evt.IsShown();
|
||||
if (evt.IsShown() && m_load_default_url) {
|
||||
m_load_default_url = false;
|
||||
load_url(m_default_url);
|
||||
@ -310,7 +311,7 @@ void WebViewPanel::on_tools_clicked(wxCommandEvent& WXUNUSED(evt))
|
||||
|
||||
void WebViewPanel::run_script(const wxString& javascript)
|
||||
{
|
||||
if (!m_browser)
|
||||
if (!m_browser || !m_shown)
|
||||
return;
|
||||
// Remember the script we run in any case, so the next time the user opens
|
||||
// the "Run Script" dialog box, it is shown there for convenient updating.
|
||||
|
@ -87,6 +87,7 @@ protected:
|
||||
//DECLARE_EVENT_TABLE()
|
||||
|
||||
bool m_load_error_page { false };
|
||||
bool m_shown { false };
|
||||
};
|
||||
|
||||
class ConnectRequestHandler
|
||||
|
Loading…
x
Reference in New Issue
Block a user