mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 20:01:31 +00:00
Merge branch 'main' into claude/inspiring-knuth-7cp6pk-upstream
This commit is contained in:
@@ -326,17 +326,13 @@ ConfigOption* ConfigOptionDef::create_default_option() const
|
||||
return new ConfigOptionEnumGeneric(this->enum_keys_map, this->default_value->getInt());
|
||||
|
||||
if (type == coEnums) {
|
||||
auto dft = this->default_value->clone();
|
||||
if (dft->nullable()) {
|
||||
ConfigOptionEnumsGenericNullable *opt = dynamic_cast<ConfigOptionEnumsGenericNullable *>(this->default_value->clone());
|
||||
opt->keys_map = this->enum_keys_map;
|
||||
return opt;
|
||||
} else {
|
||||
ConfigOptionEnumsGeneric *opt = dynamic_cast<ConfigOptionEnumsGeneric *>(this->default_value->clone());
|
||||
opt->keys_map = this->enum_keys_map;
|
||||
return opt;
|
||||
}
|
||||
delete dft;
|
||||
// Enum list defaults are built without a keys map, which the copy needs to deserialize and serialize names.
|
||||
ConfigOption *opt = this->default_value->clone();
|
||||
if (auto *nullable_enums = dynamic_cast<ConfigOptionEnumsGenericNullable *>(opt))
|
||||
nullable_enums->keys_map = this->enum_keys_map;
|
||||
else if (auto *enums = dynamic_cast<ConfigOptionEnumsGeneric *>(opt))
|
||||
enums->keys_map = this->enum_keys_map;
|
||||
return opt;
|
||||
}
|
||||
|
||||
return this->default_value->clone();
|
||||
|
||||
@@ -264,10 +264,7 @@ void Fill::_create_gap_fill(const Surface* surface, const FillParams& params, Ex
|
||||
return p.length() < scale_(params.config->filter_out_gap_fill.value);
|
||||
}), polylines.end());
|
||||
|
||||
ExtrusionEntityCollection gap_fill;
|
||||
variable_width(polylines, erGapFill, params.flow, gap_fill.entities);
|
||||
auto gap = std::move(gap_fill.entities);
|
||||
out->append(gap);
|
||||
variable_width(polylines, erGapFill, params.flow, out->entities);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3087,6 +3087,18 @@ bool GUI_App::on_init_inner()
|
||||
d->EndModal(wxID_ABORT);
|
||||
});
|
||||
|
||||
#ifdef __APPLE__
|
||||
// A quit request from the Dock, a logout or a restart ends with AppKit calling exit() right after this event, so
|
||||
// OnExit() and ~GUI_App() never run. Shut the plugins and Python down here as ~GUI_App() does. Left to
|
||||
// PluginManager's static destructor, the shutdown locks hook state that has already been destroyed and aborts.
|
||||
wxGetApp().Bind(wxEVT_END_SESSION, [](wxCloseEvent &e) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "received wxEVT_END_SESSION";
|
||||
Slic3r::PluginManager::instance().shutdown();
|
||||
Slic3r::PythonInterpreter::instance().shutdown();
|
||||
e.Skip();
|
||||
});
|
||||
#endif
|
||||
|
||||
// Verify resources path
|
||||
const wxString resources_dir = from_u8(Slic3r::resources_dir());
|
||||
wxCHECK_MSG(wxDirExists(resources_dir), false,
|
||||
|
||||
@@ -1618,19 +1618,11 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page()
|
||||
|
||||
m_custom_camera_view = WebView::CreateWebView(this, wxEmptyString);
|
||||
m_custom_camera_view->EnableContextMenu(false);
|
||||
Bind(wxEVT_WEBVIEW_NAVIGATING, &StatusBasePanel::on_webview_navigating, this, m_custom_camera_view->GetId());
|
||||
m_web_media_controller = std::make_unique<WebMediaController>(m_custom_camera_view);
|
||||
|
||||
m_media_play_ctrl = new MediaPlayCtrl(this, m_media_ctrl, wxDefaultPosition, wxSize(-1, FromDIP(40)));
|
||||
m_media_play_ctrl->SetWebMediaController(m_web_media_controller.get());
|
||||
m_custom_camera_view->Hide();
|
||||
// m_custom_camera_view->Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, [this](wxWebViewEvent& evt) {
|
||||
// if (evt.GetString() == "leavepictureinpicture") {
|
||||
// // When leaving PiP, video gets paused in some cases and toggling play
|
||||
// // programmatically does not work.
|
||||
// m_custom_camera_view->Reload();
|
||||
// }
|
||||
// });
|
||||
|
||||
sizer->Add(m_media_ctrl, 1, wxEXPAND | wxALL, 0);
|
||||
sizer->Add(m_custom_camera_view, 1, wxEXPAND | wxALL, 0);
|
||||
@@ -1643,12 +1635,6 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page()
|
||||
return sizer;
|
||||
}
|
||||
|
||||
void StatusBasePanel::on_webview_navigating(wxWebViewEvent& evt) {
|
||||
wxGetApp().CallAfter([this] {
|
||||
remove_controls();
|
||||
});
|
||||
}
|
||||
|
||||
wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
|
||||
{
|
||||
wxBoxSizer *bSizer_right = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -5121,23 +5107,6 @@ void StatusPanel::on_camera_enter(wxMouseEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void StatusBasePanel::remove_controls()
|
||||
{
|
||||
const std::string js_cleanup_video_element = R"(
|
||||
document.body.style.overflow='hidden';
|
||||
const video = document.querySelector('video');
|
||||
video.setAttribute('style', 'width: 100% !important;');
|
||||
video.removeAttribute('controls');
|
||||
video.addEventListener('leavepictureinpicture', () => {
|
||||
window.wx.postMessage('leavepictureinpicture');
|
||||
});
|
||||
video.addEventListener('enterpictureinpicture', () => {
|
||||
window.wx.postMessage('enterpictureinpicture');
|
||||
});
|
||||
)";
|
||||
m_custom_camera_view->RunScript(js_cleanup_video_element);
|
||||
}
|
||||
|
||||
void StatusPanel::on_camera_leave(wxMouseEvent& event)
|
||||
{
|
||||
if (obj && m_camera_popup) {
|
||||
|
||||
@@ -606,8 +606,6 @@ protected:
|
||||
virtual void on_axis_ctrl_e_up_10(wxCommandEvent &event) { event.Skip(); }
|
||||
virtual void on_axis_ctrl_e_down_10(wxCommandEvent &event) { event.Skip(); }
|
||||
virtual void on_nozzle_selected(wxCommandEvent &event) { event.Skip(); }
|
||||
void remove_controls();
|
||||
void on_webview_navigating(wxWebViewEvent& evt);
|
||||
|
||||
public:
|
||||
StatusBasePanel(wxWindow * parent,
|
||||
|
||||
Reference in New Issue
Block a user