This commit is contained in:
enricoturri1966 2020-05-28 15:27:39 +02:00
commit 0599dc4df7
5 changed files with 26 additions and 29 deletions

View file

@ -85,6 +85,8 @@ void PrintConfigDef::init_common_params()
def->label = L("Max print height"); def->label = L("Max print height");
def->tooltip = L("Set this to the maximum height that can be reached by your extruder while printing."); def->tooltip = L("Set this to the maximum height that can be reached by your extruder while printing.");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->min = 0;
def->max = 1200;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(200.0)); def->set_default_value(new ConfigOptionFloat(200.0));

View file

@ -715,16 +715,24 @@ void GUI_App::update_ui_from_settings()
void GUI_App::persist_window_geometry(wxTopLevelWindow *window, bool default_maximized) void GUI_App::persist_window_geometry(wxTopLevelWindow *window, bool default_maximized)
{ {
const std::string name = into_u8(window->GetName()); const std::string name = into_u8(window->GetName());
wxTopLevelWindow* settings_dlg = dynamic_cast<MainFrame*>(window)->m_settings_dialog;
const std::string settings_dlg_name = "settings_dialog";
window->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent &event) { window->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent &event) {
window_pos_save(window, name); window_pos_save(window, name);
if (settings_dlg)
window_pos_save(settings_dlg, settings_dlg_name);
event.Skip(); event.Skip();
}); });
window_pos_restore(window, name, default_maximized); window_pos_restore(window, name, default_maximized);
if (settings_dlg)
window_pos_restore(settings_dlg, settings_dlg_name, default_maximized);
on_window_geometry(window, [=]() { on_window_geometry(window, [=]() {
window_pos_sanitize(window); window_pos_sanitize(window);
if (settings_dlg)
window_pos_sanitize(settings_dlg);
}); });
} }

View file

@ -2696,6 +2696,9 @@ bool ObjectList::can_split_instances()
bool ObjectList::can_merge_to_multipart_object() const bool ObjectList::can_merge_to_multipart_object() const
{ {
if (printer_technology() == ptSLA)
return false;
wxDataViewItemArray sels; wxDataViewItemArray sels;
GetSelections(sels); GetSelections(sels);
if (sels.IsEmpty()) if (sels.IsEmpty())

View file

@ -365,13 +365,23 @@ bool GLGizmoFdmSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
} }
} }
bool dragging_while_painting = (action == SLAGizmoEventType::Dragging && m_button_down != Button::None);
// The mouse button click detection is enabled when there is a valid hit
// or when the user clicks the clipping plane. Missing the object entirely
// shall not capture the mouse.
if (closest_hit_mesh_id != -1 || clipped_mesh_was_hit) {
if (m_button_down == Button::None)
m_button_down = ((action == SLAGizmoEventType::LeftDown) ? Button::Left : Button::Right);
}
if (closest_hit_mesh_id == -1) { if (closest_hit_mesh_id == -1) {
// In case we have no valid hit, we can return. The event will // In case we have no valid hit, we can return. The event will
// be stopped in following two cases: // be stopped in following two cases:
// 1. clicking the clipping plane // 1. clicking the clipping plane
// 2. dragging while painting (to prevent scene rotations and moving the object) // 2. dragging while painting (to prevent scene rotations and moving the object)
return clipped_mesh_was_hit return clipped_mesh_was_hit
|| (action == SLAGizmoEventType::Dragging && m_button_down != Button::None); || dragging_while_painting;
} }
// Now propagate the hits // Now propagate the hits
@ -472,10 +482,6 @@ bool GLGizmoFdmSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
} }
} }
if (m_button_down == Button::None)
m_button_down = ((action == SLAGizmoEventType::LeftDown) ? Button::Left : Button::Right);
return true; return true;
} }

View file

@ -204,29 +204,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
event.Skip(); event.Skip();
}); });
/*
Bind(wxEVT_SYS_COLOUR_CHANGED, [this](wxSysColourChangedEvent& event)
{
bool recreate_gui = false;
{
// the dialog needs to be destroyed before the call to recreate_gui()
// or sometimes the application crashes into wxDialogBase() destructor
// so we put it into an inner scope
wxMessageDialog dialog(nullptr,
_L("System color mode was changed. "
"It is possible to update the Slicer in respect to the system mode.") + "\n" +
_L("You will lose content of the plater.") + "\n\n" +
_L("Do you want to proceed?"),
wxString(SLIC3R_APP_NAME) + " - " + _L("Switching system color mode"),
wxICON_QUESTION | wxOK | wxCANCEL);
recreate_gui = dialog.ShowModal() == wxID_OK;
}
if (recreate_gui)
wxGetApp().recreate_GUI(_L("Changing of an application in respect to the system mode") + dots);
event.Skip();
});
*/
wxGetApp().persist_window_geometry(this, true); wxGetApp().persist_window_geometry(this, true);
update_ui_from_settings(); // FIXME (?) update_ui_from_settings(); // FIXME (?)
@ -350,7 +327,8 @@ void MainFrame::init_tabpanel()
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxEvent&) { m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxEvent&) {
auto panel = m_tabpanel->GetCurrentPage(); auto panel = m_tabpanel->GetCurrentPage();
if (panel == nullptr) // There shouldn't be a case, when we try to select a tab, which doesn't support a printer technology
if (panel == nullptr || !static_cast<Tab*>(panel)->supports_printer_technology(m_plater->printer_technology()))
return; return;
auto& tabs_list = wxGetApp().tabs_list; auto& tabs_list = wxGetApp().tabs_list;