Skip to content

Commit

Permalink
Fix layer height modifier layout (SoftFever#2708) (SoftFever#2756)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Nov 16, 2023
1 parent 565732a commit 2fc5a7d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/slic3r/GUI/GUI_ObjectLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ namespace GUI
ObjectLayers::ObjectLayers(wxWindow* parent) :
OG_Settings(parent, true)
{
m_grid_sizer = new wxFlexGridSizer(3, 0, wxGetApp().em_unit()); // "Min Z", "Max Z", "Layer height" & buttons sizer
m_grid_sizer = new wxFlexGridSizer(5, 0, wxGetApp().em_unit()); // Title, Min Z, "to", Max Z, unit & buttons sizer
m_grid_sizer->SetFlexibleDirection(wxHORIZONTAL);
m_grid_sizer->AddGrowableCol(1);
m_grid_sizer->AddGrowableCol(3);

m_og->activate();
m_og->sizer->Clear(true);
Expand Down Expand Up @@ -75,7 +77,7 @@ wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinus
auto head_text = new wxStaticText(m_parent, wxID_ANY, _L("Height Range"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
head_text->SetBackgroundStyle(wxBG_STYLE_PAINT);
head_text->SetFont(wxGetApp().normal_font());
m_grid_sizer->Add(head_text, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, wxGetApp().em_unit());
m_grid_sizer->Add(head_text, 0, wxALIGN_CENTER_VERTICAL);

// Add control for the "Min Z"

Expand All @@ -101,14 +103,12 @@ wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinus

select_editor(editor, is_last_edited_range);

auto sizer1 = new wxBoxSizer(wxHORIZONTAL);
sizer1->Add(editor);
m_grid_sizer->Add(editor, 1, wxEXPAND);

auto middle_text = new wxStaticText(m_parent, wxID_ANY, _L("to"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
middle_text->SetBackgroundStyle(wxBG_STYLE_PAINT);
middle_text->SetFont(wxGetApp().normal_font());
sizer1->Add(middle_text, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, wxGetApp().em_unit());

m_grid_sizer->Add(sizer1);
m_grid_sizer->Add(middle_text, 0, wxALIGN_CENTER_VERTICAL);

// Add control for the "Max Z"

Expand All @@ -132,13 +132,13 @@ wxSizer* ObjectLayers::create_layer(const t_layer_height_range& range, PlusMinus
});

//select_editor(editor, is_last_edited_range);
m_grid_sizer->Add(editor, 1, wxEXPAND);

auto sizer2 = new wxBoxSizer(wxHORIZONTAL);
sizer2->Add(editor);
auto unit_text = new wxStaticText(m_parent, wxID_ANY, _L("mm"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
unit_text->SetBackgroundStyle(wxBG_STYLE_PAINT);
unit_text->SetFont(wxGetApp().normal_font());
sizer2->Add(unit_text, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, wxGetApp().em_unit());
sizer2->Add(unit_text, 0, wxALIGN_CENTER_VERTICAL);

m_grid_sizer->Add(sizer2);

Expand Down Expand Up @@ -335,7 +335,7 @@ LayerRangeEditor::LayerRangeEditor( ObjectLayers* parent,
m_type(type),
m_set_focus_data(set_focus_data_fn),
wxTextCtrl(parent->m_parent, wxID_ANY, value, wxDefaultPosition,
wxSize(8 * em_unit(parent->m_parent), wxDefaultCoord), wxTE_PROCESS_ENTER
wxSize(em_unit(parent->m_parent), wxDefaultCoord), wxTE_PROCESS_ENTER
#ifdef _WIN32
| wxBORDER_SIMPLE
#endif
Expand Down Expand Up @@ -444,7 +444,7 @@ coordf_t LayerRangeEditor::get_value()

void LayerRangeEditor::msw_rescale()
{
SetMinSize(wxSize(8 * wxGetApp().em_unit(), wxDefaultCoord));
SetMinSize(wxSize(wxGetApp().em_unit(), wxDefaultCoord));
}

} //namespace GUI
Expand Down

0 comments on commit 2fc5a7d

Please sign in to comment.