Merge branch 'updating' of https://github.com/prusa3d/Slic3r into updating

This commit is contained in:
Enrico Turri 2018-04-25 13:56:26 +02:00
commit df3e84d580
4 changed files with 11 additions and 12 deletions

View File

@ -486,7 +486,7 @@ sub new {
my $right_sizer = Wx::BoxSizer->new(wxVERTICAL); my $right_sizer = Wx::BoxSizer->new(wxVERTICAL);
$right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets; $right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets;
$right_sizer->Add($frequently_changed_parameters_sizer, 0, wxEXPAND | wxTOP, 10) if defined $frequently_changed_parameters_sizer; $right_sizer->Add($frequently_changed_parameters_sizer, 0, wxEXPAND | wxTOP, 0) if defined $frequently_changed_parameters_sizer;
$right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM, 5); $right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM, 5);
$right_sizer->Add($self->{list}, 1, wxEXPAND, 5); $right_sizer->Add($self->{list}, 1, wxEXPAND, 5);
$right_sizer->Add($object_info_sizer, 0, wxEXPAND, 0); $right_sizer->Add($object_info_sizer, 0, wxEXPAND, 0);

View File

@ -791,8 +791,8 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
{ {
DynamicPrintConfig* config = &g_PresetBundle->prints.get_edited_preset().config; DynamicPrintConfig* config = &g_PresetBundle->prints.get_edited_preset().config;
m_optgroup = std::make_shared<ConfigOptionsGroup>(parent, "", config); m_optgroup = std::make_shared<ConfigOptionsGroup>(parent, "", config);
const wxArrayInt& ar = preset_sizer->GetColWidths(); // const wxArrayInt& ar = preset_sizer->GetColWidths();
m_optgroup->label_width = ar.IsEmpty() ? 100 : ar.front(); // m_optgroup->label_width = ar.IsEmpty() ? 100 : ar.front(); // doesn't work
m_optgroup->m_on_change = [config](t_config_option_key opt_key, boost::any value){ m_optgroup->m_on_change = [config](t_config_option_key opt_key, boost::any value){
TabPrint* tab_print = nullptr; TabPrint* tab_print = nullptr;
for (size_t i = 0; i < g_wxTabPanel->GetPageCount(); ++i) { for (size_t i = 0; i < g_wxTabPanel->GetPageCount(); ++i) {
@ -846,10 +846,9 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
tab_print->update_dirty(); tab_print->update_dirty();
}; };
const int width = 250;
Option option = m_optgroup->get_option("fill_density"); Option option = m_optgroup->get_option("fill_density");
option.opt.sidetext = ""; option.opt.sidetext = "";
option.opt.width = width; option.opt.full_width = true;
m_optgroup->append_single_option_line(option); m_optgroup->append_single_option_line(option);
ConfigOptionDef def; ConfigOptionDef def;
@ -868,7 +867,7 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
"Everywhere"; "Everywhere";
def.default_value = new ConfigOptionStrings { selection }; def.default_value = new ConfigOptionStrings { selection };
option = Option(def, "support"); option = Option(def, "support");
option.opt.width = width; option.opt.full_width = true;
m_optgroup->append_single_option_line(option); m_optgroup->append_single_option_line(option);
m_brim_width = config->opt_float("brim_width"); m_brim_width = config->opt_float("brim_width");
@ -907,7 +906,7 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
sizer->Add(m_optgroup->sizer, 0, wxEXPAND | wxBOTTOM | wxBottom, 1); sizer->Add(m_optgroup->sizer, 1, wxEXPAND | wxBOTTOM, 2);
} }
ConfigOptionsGroup* get_optgroup() ConfigOptionsGroup* get_optgroup()

View File

@ -137,11 +137,11 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** colored_Label/*
// Build a label if we have it // Build a label if we have it
wxStaticText* label=nullptr; wxStaticText* label=nullptr;
if (label_width != 0) { if (label_width != 0) {
label = new wxStaticText(parent(), wxID_ANY, line.label + (line.label.IsEmpty() ? "" : ":"), label = new wxStaticText(parent(), wxID_ANY, line.label + (line.label.IsEmpty() ? "" : ": "),
wxDefaultPosition, wxSize(label_width, -1)); wxDefaultPosition, staticbox ? wxSize(label_width, -1) : wxDefaultSize);
label->SetFont(label_font); label->SetFont(label_font);
label->Wrap(label_width); // avoid a Linux/GTK bug label->Wrap(label_width); // avoid a Linux/GTK bug
grid_sizer->Add(label, 0, wxALIGN_CENTER_VERTICAL,0); grid_sizer->Add(label, 0, (staticbox ? 0 : wxALIGN_RIGHT) | wxALIGN_CENTER_VERTICAL, 0);
if (line.label_tooltip.compare("") != 0) if (line.label_tooltip.compare("") != 0)
label->SetToolTip(line.label_tooltip); label->SetToolTip(line.label_tooltip);
} }
@ -166,7 +166,7 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** colored_Label/*
sizer->Add(field->m_Undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL); sizer->Add(field->m_Undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL);
sizer->Add(field->m_Undo_btn, 0, wxALIGN_CENTER_VERTICAL); sizer->Add(field->m_Undo_btn, 0, wxALIGN_CENTER_VERTICAL);
if (is_window_field(field)) if (is_window_field(field))
sizer->Add(field->getWindow(), 0, (option.opt.full_width ? wxEXPAND : 0) | sizer->Add(field->getWindow(), option.opt.full_width ? 1 : 0, (option.opt.full_width ? wxEXPAND : 0) |
wxBOTTOM | wxTOP | wxALIGN_CENTER_VERTICAL, wxOSX ? 0 : 2); wxBOTTOM | wxTOP | wxALIGN_CENTER_VERTICAL, wxOSX ? 0 : 2);
if (is_sizer_field(field)) if (is_sizer_field(field))
sizer->Add(field->getSizer(), 0, (option.opt.full_width ? wxEXPAND : 0) | wxALIGN_CENTER_VERTICAL, 0); sizer->Add(field->getSizer(), 0, (option.opt.full_width ? wxEXPAND : 0) | wxALIGN_CENTER_VERTICAL, 0);

View File

@ -131,7 +131,7 @@ public:
static_cast<wxFlexGridSizer*>(m_grid_sizer)->SetFlexibleDirection(wxHORIZONTAL); static_cast<wxFlexGridSizer*>(m_grid_sizer)->SetFlexibleDirection(wxHORIZONTAL);
static_cast<wxFlexGridSizer*>(m_grid_sizer)->AddGrowableCol(label_width != 0); static_cast<wxFlexGridSizer*>(m_grid_sizer)->AddGrowableCol(label_width != 0);
sizer->Add(m_grid_sizer, 0, wxEXPAND | wxALL, wxOSX ? 0: 5); sizer->Add(m_grid_sizer, 0, wxEXPAND | wxALL, wxOSX||!staticbox ? 0: 5);
} }
protected: protected: