mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
ENH: refine intersection of height range [STUDIO-2830]
Change-Id: I5dab3a9e2e6e4a9e5afe7d86a18a4d247d26a03e
This commit is contained in:
parent
4b2d52ac0c
commit
fa4d2b654d
1 changed files with 8 additions and 6 deletions
|
@ -35,7 +35,7 @@ ObjectLayers::ObjectLayers(wxWindow* parent) :
|
||||||
|
|
||||||
void ObjectLayers::select_editor(LayerRangeEditor* editor, const bool is_last_edited_range)
|
void ObjectLayers::select_editor(LayerRangeEditor* editor, const bool is_last_edited_range)
|
||||||
{
|
{
|
||||||
if (is_last_edited_range && m_selection_type == editor->type()) {
|
//if (is_last_edited_range && m_selection_type == editor->type()) {
|
||||||
/* Workaround! Under OSX we should use CallAfter() for SetFocus() after LayerEditors "reorganizations",
|
/* Workaround! Under OSX we should use CallAfter() for SetFocus() after LayerEditors "reorganizations",
|
||||||
* because of selected control's strange behavior:
|
* because of selected control's strange behavior:
|
||||||
* cursor is set to the control, but blue border - doesn't.
|
* cursor is set to the control, but blue border - doesn't.
|
||||||
|
@ -45,11 +45,11 @@ void ObjectLayers::select_editor(LayerRangeEditor* editor, const bool is_last_ed
|
||||||
wxTheApp->CallAfter([editor]() {
|
wxTheApp->CallAfter([editor]() {
|
||||||
#endif
|
#endif
|
||||||
editor->SetFocus();
|
editor->SetFocus();
|
||||||
editor->SetInsertionPointEnd();
|
editor->SelectAll();
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinusButton *delete_button, PlusMinusButton *add_button)
|
wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinusButton *delete_button, PlusMinusButton *add_button)
|
||||||
|
@ -131,7 +131,7 @@ wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinus
|
||||||
return wxGetApp().obj_list()->edit_layer_range(range, new_range, dont_update_ui);
|
return wxGetApp().obj_list()->edit_layer_range(range, new_range, dont_update_ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
select_editor(editor, is_last_edited_range);
|
//select_editor(editor, is_last_edited_range);
|
||||||
|
|
||||||
auto sizer2 = new wxBoxSizer(wxHORIZONTAL);
|
auto sizer2 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizer2->Add(editor);
|
sizer2->Add(editor);
|
||||||
|
@ -170,11 +170,13 @@ void ObjectLayers::create_layers_list()
|
||||||
{
|
{
|
||||||
for (const auto &layer : m_object->layer_config_ranges) {
|
for (const auto &layer : m_object->layer_config_ranges) {
|
||||||
const t_layer_height_range& range = layer.first;
|
const t_layer_height_range& range = layer.first;
|
||||||
auto del_btn = new PlusMinusButton(m_parent, m_bmp_delete, range);
|
auto del_btn = new PlusMinusButton(m_parent, m_bmp_delete, range);
|
||||||
|
del_btn->DisableFocusFromKeyboard();
|
||||||
del_btn->SetBackgroundColour(m_parent->GetBackgroundColour());
|
del_btn->SetBackgroundColour(m_parent->GetBackgroundColour());
|
||||||
del_btn->SetToolTip(_L("Remove height range"));
|
del_btn->SetToolTip(_L("Remove height range"));
|
||||||
|
|
||||||
auto add_btn = new PlusMinusButton(m_parent, m_bmp_add, range);
|
auto add_btn = new PlusMinusButton(m_parent, m_bmp_add, range);
|
||||||
|
add_btn->DisableFocusFromKeyboard();
|
||||||
add_btn->SetBackgroundColour(m_parent->GetBackgroundColour());
|
add_btn->SetBackgroundColour(m_parent->GetBackgroundColour());
|
||||||
wxString tooltip = wxGetApp().obj_list()->can_add_new_range_after_current(range);
|
wxString tooltip = wxGetApp().obj_list()->can_add_new_range_after_current(range);
|
||||||
add_btn->SetToolTip(tooltip.IsEmpty() ? _L("Add height range") : tooltip);
|
add_btn->SetToolTip(tooltip.IsEmpty() ? _L("Add height range") : tooltip);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue