Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_shortcuts_dialog

This commit is contained in:
Enrico Turri 2020-02-12 15:01:53 +01:00
commit 4d556b40d1
9 changed files with 1377 additions and 1354 deletions

File diff suppressed because it is too large Load diff

View file

@ -64,8 +64,8 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
boost::filesystem::path filename = format.empty() ?
cfg.opt_string("input_filename_base") + default_ext :
this->placeholder_parser().process(format, 0, &cfg);
if (filename.extension().empty())
filename = boost::filesystem::change_extension(filename, default_ext);
if (filename.extension().string() != default_ext)
filename = boost::filesystem::change_extension(filename, default_ext);
return filename.string();
} catch (std::runtime_error &err) {
throw std::runtime_error(L("Failed processing of the output_filename_format template.") + "\n" + err.what());

View file

@ -573,7 +573,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("If layer print time is estimated below this number of seconds, fan will be enabled "
"and its speed will be calculated by interpolating the minimum and maximum speeds.");
def->sidetext = L("approximate seconds");
def->width = 6;
def->min = 0;
def->max = 1000;
def->mode = comExpert;
@ -1104,7 +1103,6 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(true));
const int machine_limits_opt_width = 7;
{
struct AxisDefault {
std::string name;
@ -1136,7 +1134,6 @@ void PrintConfigDef::init_fff_params()
(void)L("Maximum feedrate of the E axis");
def->sidetext = L("mm/s");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats(axis.max_feedrate));
// Add the machine acceleration limits for XYZE axes (M201)
@ -1154,7 +1151,6 @@ void PrintConfigDef::init_fff_params()
(void)L("Maximum acceleration of the E axis");
def->sidetext = L("mm/s²");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats(axis.max_acceleration));
// Add the machine jerk limits for XYZE axes (M205)
@ -1172,7 +1168,6 @@ void PrintConfigDef::init_fff_params()
(void)L("Maximum jerk of the E axis");
def->sidetext = L("mm/s");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats(axis.max_jerk));
}
@ -1185,7 +1180,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Minimum feedrate when extruding (M205 S)");
def->sidetext = L("mm/s");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 0., 0. });
@ -1196,7 +1190,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Minimum travel feedrate (M205 T)");
def->sidetext = L("mm/s");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 0., 0. });
@ -1207,7 +1200,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Maximum acceleration when extruding (M204 S)");
def->sidetext = L("mm/s²");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 1500., 1250. });
@ -1218,7 +1210,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("Maximum acceleration when retracting (M204 T)");
def->sidetext = L("mm/s²");
def->min = 0;
def->width = machine_limits_opt_width;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 1500., 1250. });
@ -1715,7 +1706,6 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("If layer print time is estimated below this number of seconds, print moves "
"speed will be scaled down to extend duration to this value.");
def->sidetext = L("approximate seconds");
def->width = 6;
def->min = 0;
def->max = 1000;
def->mode = comExpert;

View file

@ -76,7 +76,7 @@ Control::Control( wxWindow *parent,
m_cog_icon_dim = m_bmp_cog.GetBmpWidth();
m_selection = ssUndef;
m_ticks.set_pause_print_msg(_utf8(L("Place bearings in slots and resume")));
m_ticks.set_pause_print_msg(_utf8(L("Place bearings in slots and resume printing")));
// slider events
this->Bind(wxEVT_PAINT, &Control::OnPaint, this);
@ -924,13 +924,13 @@ wxString Control::get_tooltip(int tick/*=-1*/)
if (m_focus == fiRevertIcon)
return _(L("Discard all custom changes"));
if (m_focus == fiCogIcon)
return m_mode == t_mode::MultiAsSingle ?
_(L("For jump to print Z use left mouse button click OR (Shift+G)")) + "\n" +
_(L("For set extruder sequence for whole print use right mouse button click")) :
_(L("Jump to print Z")) + " (Shift+G)";
return m_mode == t_mode::MultiAsSingle ?
wxString::Format(_(L("Jump to height %s or "
"Set extruder sequence for the entire print")), " (Shift + G)\n") :
_(L("Jump to height")) + " (Shift + G)";
if (m_focus == fiColorBand)
return m_mode != t_mode::SingleExtruder ? "" :
_(L("For edit current color use right mouse button click on colored band"));
_(L("Edit current color - Right click the colored slider segment"));
wxString tooltip;
const auto tick_code_it = m_ticks.ticks.find(TickCode{tick});
@ -938,7 +938,7 @@ wxString Control::get_tooltip(int tick/*=-1*/)
if (tick_code_it == m_ticks.ticks.end() && m_focus == fiActionIcon) // tick doesn't exist
{
// Show mode as a first string of tooltop
tooltip = " " + _(L("Slider(print) mode")) + ": ";
tooltip = " " + _(L("Print mode")) + ": ";
tooltip += (m_mode == t_mode::SingleExtruder ? CustomGCode::SingleExtruderMode :
m_mode == t_mode::MultiAsSingle ? CustomGCode::MultiAsSingleMode :
CustomGCode::MultiExtruderMode );
@ -952,16 +952,15 @@ wxString Control::get_tooltip(int tick/*=-1*/)
// Show list of actions with new tick
tooltip += ( m_mode == t_mode::MultiAsSingle ?
_(L("For add change extruder use left mouse button click")) :
_(L("Add extruder change - Left click")) :
m_mode == t_mode::SingleExtruder ?
_(L("For add color change use left mouse button click "
"if you want to use colors from default color list, "
"or Shift + left mouse button click if you want to select a color")) :
_(L("For add color change use left mouse button click")) ) + " " +
_(L("OR pres \"+\" key")) + "\n" + (
_(L("Add color change - Left click for predefined color or"
"Shift + Left click for custom color selection")) :
_(L("Add color change - Left click")) ) + " " +
_(L("or press \"+\" key")) + "\n" + (
is_osx ?
_(L("For add another code use Ctrl + left mouse button click")) :
_(L("For add another code use right mouse button click")) );
_(L("Add another code - Ctrl + Left click")) :
_(L("Add another code - Right click")) );
}
if (tick_code_it != m_ticks.ticks.end()) // tick exists
@ -976,7 +975,7 @@ wxString Control::get_tooltip(int tick/*=-1*/)
tick_code_it->gcode == PausePrintCode ?
from_u8((boost::format(_utf8(L("Pause print (\"%1%\")"))) % tick_code_it->gcode ).str()) :
tick_code_it->gcode == ToolChangeCode ?
from_u8((boost::format(_utf8(L("Extruder(tool) is changed to Extruder \"%1%\""))) % tick_code_it->extruder ).str()) :
from_u8((boost::format(_utf8(L("Extruder (tool) is changed to Extruder \"%1%\""))) % tick_code_it->extruder ).str()) :
from_u8((boost::format(_utf8(L("\"%1%\""))) % tick_code_it->gcode ).str()) ;
// If tick is marked as a conflict (exclamation icon),
@ -985,24 +984,24 @@ wxString Control::get_tooltip(int tick/*=-1*/)
if (conflict != ctNone)
tooltip += "\n\n" + _(L("Note")) + "! ";
if (conflict == ctModeConflict)
tooltip += _(L("G-code of this tick has a conflict with slider(print) mode.\n"
"Any its editing will cause a changes of DoubleSlider data."));
tooltip += _(L("G-code associated to this tick mark is in a conflict with print mode.\n"
"Editing it will cause changes of Slider data."));
else if (conflict == ctMeaninglessColorChange)
tooltip += _(L("There is a color change for extruder that wouldn't be used till the end of printing.\n"
"This code wouldn't be processed during GCode generation."));
tooltip += _(L("There is a color change for extruder that won't be used till the end of print job.\n"
"This code won't be processed during G-code generation."));
else if (conflict == ctMeaninglessToolChange)
tooltip += _(L("There is a extruder change to the same extruder.\n"
"This code wouldn't be processed during GCode generation."));
tooltip += _(L("There is an extruder change set to the same extruder.\n"
"This code won't be processed during G-code generation."));
else if (conflict == ctRedundant)
tooltip += _(L("There is a color change for extruder that has not been used before.\n"
"Check your choice to avoid redundant color changes."));
"Check your settings to avoid redundant color changes."));
// Show list of actions with existing tick
if (m_focus == fiActionIcon)
tooltip += "\n\n" + _(L("For Delete tick use left mouse button click OR pres \"-\" key")) + "\n" + (
tooltip += "\n\n" + _(L("Delete tick mark - Left click or press \"-\" key")) + "\n" + (
is_osx ?
_(L("For Edit tick use Ctrl + Left mouse button click")) :
_(L("For Edit tick use right mouse button click")) );
_(L("Edit tick mark - Ctrl + Left click")) :
_(L("Edit tick mark - Right click")) );
}
return tooltip;
@ -1499,10 +1498,10 @@ void Control::show_cog_icon_context_menu()
{
wxMenu menu;
append_menu_item(&menu, wxID_ANY, _(L("Jump to print Z")) + " (Shift+G)", "",
append_menu_item(&menu, wxID_ANY, _(L("Jump to height")) + " (Shift+G)", "",
[this](wxCommandEvent&) { jump_to_print_z(); }, "", &menu);
append_menu_item(&menu, wxID_ANY, _(L("Set extruder sequence for whole print")), "",
append_menu_item(&menu, wxID_ANY, _(L("Set extruder sequence for the entire print")), "",
[this](wxCommandEvent&) { edit_extruder_sequence(); }, "", &menu);
GUI::wxGetApp().plater()->PopupMenu(&menu);
@ -1589,7 +1588,7 @@ static void upgrade_text_entry_dialog(wxTextEntryDialog* dlg, double min = -1.0,
static std::string get_custom_code(const std::string& code_in, double height)
{
wxString msg_text = from_u8(_utf8(L("Enter custom G-code used on current layer"))) + ":";
wxString msg_header = from_u8((boost::format(_utf8(L("Custom Gcode on current layer (%1% mm)."))) % height).str());
wxString msg_header = from_u8((boost::format(_utf8(L("Custom G-code on current layer (%1% mm)."))) % height).str());
// get custom gcode
wxTextEntryDialog dlg(nullptr, msg_text, msg_header, code_in,
@ -1604,7 +1603,7 @@ static std::string get_custom_code(const std::string& code_in, double height)
static std::string get_pause_print_msg(const std::string& msg_in, double height)
{
wxString msg_text = from_u8(_utf8(L("Enter short message shown on Printer display during pause print"))) + ":";
wxString msg_text = from_u8(_utf8(L("Enter short message shown on Printer display when a print is paused"))) + ":";
wxString msg_header = from_u8((boost::format(_utf8(L("Message for pause print on current layer (%1% mm)."))) % height).str());
// get custom gcode
@ -1620,8 +1619,8 @@ static std::string get_pause_print_msg(const std::string& msg_in, double height)
static double get_print_z_to_jump(double active_print_z, double min_z, double max_z)
{
wxString msg_text = _(L("Enter print z value to jump to")) + " :";
wxString msg_header = _(L("Jump to print z"));
wxString msg_text = _(L("Enter the height you want to jump to")) + " :";
wxString msg_header = _(L("Jump to height"));
wxString msg_in = GUI::double_to_string(active_print_z);
// get custom gcode
@ -1873,7 +1872,7 @@ bool Control::check_ticks_changed_event(const std::string& gcode)
_(L("The last color change data was saved for a single extruder printer profile.")) :
_(L("The last color change data was saved for a multiple extruder printer profile."))
) + "\n" +
_(L("Your current changes will cause a deletion of all saved color changes.")) + "\n\n\t" +
_(L("Your current changes will delete all saved color changes.")) + "\n\n\t" +
_(L("Are you sure you want to continue?"));
wxMessageDialog msg(this, message, _(L("Notice")), wxYES_NO);
@ -1890,11 +1889,11 @@ bool Control::check_ticks_changed_event(const std::string& gcode)
_(L("The last color change data was saved for a multi extruder printing.")) + "\n\n" +
_(L("Select YES if you want to delete all saved tool changes, \n\t"
"NO if you want all tool changes switch to color changes, \n\t"
"or CANCEL for do nothing")) + "\n\n\t" +
"or CANCEL to leave it unchanged")) + "\n\n\t" +
_(L("Do you want to delete all saved tool changes?"))
) : ( // t_mode::MultiExtruder
_(L("The last color change data was saved for a multi extruder printing with tool changes for whole print.")) + "\n\n" +
_(L("Your current changes will cause a deletion of all saved tool changes.")) + "\n\n\t" +
_(L("Your current changes will delete all saved extruder (tool) changes.")) + "\n\n\t" +
_(L("Are you sure you want to continue?")) ) ;
wxMessageDialog msg(this, message, _(L("Notice")), wxYES_NO | (m_mode == t_mode::SingleExtruder ? wxCANCEL : 0));

View file

@ -250,6 +250,23 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
}
}
void Field::msw_rescale(bool rescale_sidetext)
{
m_Undo_to_sys_btn->msw_rescale();
m_Undo_btn->msw_rescale();
// update em_unit value
m_em_unit = em_unit(m_parent);
// update sidetext if it is needed
if (m_side_text && rescale_sidetext)
{
auto size = wxSize(def_width_thinner() * m_em_unit, -1);
m_side_text->SetSize(size);
m_side_text->SetMinSize(size);
}
}
template<class T>
bool is_defined_input_value(wxWindow* win, const ConfigOptionType& type)
{
@ -259,7 +276,7 @@ bool is_defined_input_value(wxWindow* win, const ConfigOptionType& type)
}
void TextCtrl::BUILD() {
auto size = wxSize(wxDefaultSize);
auto size = wxSize(def_width()*m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
@ -455,10 +472,10 @@ boost::any& TextCtrl::get_value()
return m_value;
}
void TextCtrl::msw_rescale()
void TextCtrl::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
auto size = wxSize(wxDefaultSize);
Field::msw_rescale(rescale_sidetext);
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
@ -555,7 +572,7 @@ boost::any& CheckBox::get_value()
return m_value;
}
void CheckBox::msw_rescale()
void CheckBox::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
@ -565,7 +582,7 @@ void CheckBox::msw_rescale()
void SpinCtrl::BUILD() {
auto size = wxSize(wxDefaultSize);
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
@ -690,16 +707,16 @@ void SpinCtrl::propagate_value()
suppress_propagation = false;
}
void SpinCtrl::msw_rescale()
void SpinCtrl::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
Field::msw_rescale(rescale_sidetext);
wxSpinCtrl* field = dynamic_cast<wxSpinCtrl*>(window);
field->SetMinSize(wxSize(-1, int(1.9f*field->GetFont().GetPixelSize().y)));
field->SetMinSize(wxSize(def_width() * m_em_unit, int(1.9f*field->GetFont().GetPixelSize().y)));
}
void Choice::BUILD() {
wxSize size(m_width * m_em_unit, -1);
wxSize size(def_width_wider() * m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
@ -1018,7 +1035,7 @@ boost::any& Choice::get_value()
return m_value;
}
void Choice::msw_rescale()
void Choice::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
@ -1034,7 +1051,7 @@ void Choice::msw_rescale()
*/
field->Clear();
wxSize size(wxDefaultSize);
size.SetWidth((m_opt.width > 0 ? m_opt.width : m_width) * m_em_unit);
size.SetWidth((m_opt.width > 0 ? m_opt.width : def_width_wider()) * m_em_unit);
// Set rescaled min height to correct layout
field->SetMinSize(wxSize(-1, int(1.5f*field->GetFont().GetPixelSize().y + 0.5f)));
@ -1065,7 +1082,7 @@ void Choice::msw_rescale()
void ColourPicker::BUILD()
{
auto size = wxSize(wxDefaultSize);
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height*m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width*m_em_unit);
@ -1133,11 +1150,16 @@ boost::any& ColourPicker::get_value()
return m_value;
}
void ColourPicker::msw_rescale()
void ColourPicker::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
wxColourPickerCtrl* field = dynamic_cast<wxColourPickerCtrl*>(window);
wxColourPickerCtrl* field = dynamic_cast<wxColourPickerCtrl*>(window);
auto size = wxSize(def_width() * m_em_unit, wxDefaultCoord);
if (m_opt.height >= 0) size.SetHeight(m_opt.height * m_em_unit);
if (m_opt.width >= 0) size.SetWidth(m_opt.width * m_em_unit);
field->SetMinSize(size);
if (field->GetColour() == wxTransparentColour)
set_undef_value(field);
}
@ -1189,7 +1211,7 @@ void PointCtrl::BUILD()
y_textctrl->SetToolTip(get_tooltip_text(X+", "+Y));
}
void PointCtrl::msw_rescale()
void PointCtrl::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();
@ -1259,7 +1281,7 @@ void StaticText::BUILD()
temp->SetToolTip(get_tooltip_text(legend));
}
void StaticText::msw_rescale()
void StaticText::msw_rescale(bool rescale_sidetext/* = false*/)
{
Field::msw_rescale();

View file

@ -220,17 +220,16 @@ public:
m_side_text = side_text;
}
virtual void msw_rescale() {
m_Undo_to_sys_btn->msw_rescale();
m_Undo_btn->msw_rescale();
// update em_unit value
m_em_unit = em_unit(m_parent);
}
virtual void msw_rescale(bool rescale_sidetext = false);
bool get_enter_pressed() const { return bEnterPressed; }
void set_enter_pressed(bool pressed) { bEnterPressed = pressed; }
// Values of width to "systematic" alignments of fields
static int def_width() { return 7; }
static int def_width_wider() { return 14; }
static int def_width_thinner() { return 4; }
protected:
RevertButton* m_Undo_btn = nullptr;
// Bitmap and Tooltip text for m_Undo_btn. The wxButton will be updated only if the new wxBitmap pointer differs from the currently rendered one.
@ -297,7 +296,7 @@ public:
boost::any& get_value() override;
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
virtual void enable();
virtual void disable();
@ -325,7 +324,7 @@ public:
void set_na_value() override;
boost::any& get_value() override;
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override { dynamic_cast<wxCheckBox*>(window)->Enable(); }
void disable() override { dynamic_cast<wxCheckBox*>(window)->Disable(); }
@ -368,7 +367,7 @@ public:
return m_value = value;
}
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override { dynamic_cast<wxSpinCtrl*>(window)->Enable(); }
void disable() override { dynamic_cast<wxSpinCtrl*>(window)->Disable(); }
@ -377,7 +376,6 @@ public:
class Choice : public Field {
using Field::Field;
int m_width{ 15 };
public:
Choice(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
Choice(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {}
@ -397,7 +395,7 @@ public:
void set_values(const std::vector<std::string> &values);
boost::any& get_value() override;
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override { dynamic_cast<wxBitmapComboBox*>(window)->Enable(); };
void disable() override{ dynamic_cast<wxBitmapComboBox*>(window)->Disable(); };
@ -423,7 +421,7 @@ public:
}
void set_value(const boost::any& value, bool change_event = false) override;
boost::any& get_value() override;
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override { dynamic_cast<wxColourPickerCtrl*>(window)->Enable(); };
void disable() override{ dynamic_cast<wxColourPickerCtrl*>(window)->Disable(); };
@ -448,7 +446,7 @@ public:
void set_value(const boost::any& value, bool change_event = false);
boost::any& get_value() override;
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override {
x_textctrl->Enable();
@ -482,7 +480,7 @@ public:
boost::any& get_value()override { return m_value; }
void msw_rescale() override;
void msw_rescale(bool rescale_sidetext = false) override;
void enable() override { dynamic_cast<wxStaticText*>(window)->Enable(); };
void disable() override{ dynamic_cast<wxStaticText*>(window)->Disable(); };

View file

@ -128,6 +128,10 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** full_Label/* = n
for (auto opt : option_set)
m_options.emplace(opt.opt_id, opt);
// Set sidetext width for a better alignment of options in line
if (option_set.size() > 1)
sidetext_width = Field::def_width_thinner();
// add mode value for current line to m_options_mode
if (!option_set.empty())
m_options_mode.push_back(option_set[0].opt.mode);
@ -274,9 +278,9 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** full_Label/* = n
sizer_tmp->Add(field->getWindow(), 0, wxALIGN_CENTER_VERTICAL, 0);
// add sidetext if any
if (option.sidetext != "") {
if (!option.sidetext.empty() || sidetext_width > 0) {
auto sidetext = new wxStaticText( this->ctrl_parent(), wxID_ANY, _(option.sidetext), wxDefaultPosition,
wxSize(sidetext_width != -1 ? sidetext_width*wxGetApp().em_unit() : -1, -1) /*wxDefaultSize*/, wxALIGN_LEFT);
wxSize(sidetext_width != -1 ? sidetext_width*wxGetApp().em_unit() : -1, -1), wxALIGN_LEFT);
sidetext->SetBackgroundStyle(wxBG_STYLE_PAINT);
sidetext->SetFont(wxGetApp().normal_font());
sizer_tmp->Add(sidetext, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 4);
@ -498,7 +502,7 @@ void ConfigOptionsGroup::msw_rescale()
// update undo buttons : rescale bitmaps
for (const auto& field : m_fields)
field.second->msw_rescale();
field.second->msw_rescale(sidetext_width>0);
const int em = em_unit(parent());

View file

@ -518,6 +518,18 @@ void TabPrinter::init_options_list()
m_options_list.emplace("extruders_count", m_opt_status_value);
}
void TabPrinter::msw_rescale()
{
Tab::msw_rescale();
// rescale missed options_groups
const std::vector<PageShp>& pages = m_printer_technology == ptFFF ? m_pages_sla : m_pages_fff;
for (auto page : pages)
page->msw_rescale();
Layout();
}
void TabSLAMaterial::init_options_list()
{
if (!m_options_list.empty())
@ -1221,18 +1233,14 @@ void TabPrint::build()
optgroup = page->new_optgroup(_(L("Sequential printing")));
optgroup->append_single_option_line("complete_objects");
line = { _(L("Extruder clearance (mm)")), "" };
Option option = optgroup->get_option("extruder_clearance_radius");
option.opt.width = 6;
line.append_option(option);
option = optgroup->get_option("extruder_clearance_height");
option.opt.width = 6;
line.append_option(option);
line.append_option(optgroup->get_option("extruder_clearance_radius"));
line.append_option(optgroup->get_option("extruder_clearance_height"));
optgroup->append_line(line);
optgroup = page->new_optgroup(_(L("Output file")));
optgroup->append_single_option_line("gcode_comments");
optgroup->append_single_option_line("gcode_label_objects");
option = optgroup->get_option("output_filename_format");
Option option = optgroup->get_option("output_filename_format");
option.opt.full_width = true;
optgroup->append_single_option_line(option);
@ -1463,7 +1471,10 @@ void TabFilament::build()
page = add_options_page(_(L("Advanced")), "wrench");
optgroup = page->new_optgroup(_(L("Filament properties")));
optgroup->append_single_option_line("filament_type");
// Set size as all another fields for a better alignment
Option option = optgroup->get_option("filament_type");
option.opt.width = Field::def_width();
optgroup->append_single_option_line(option);
optgroup->append_single_option_line("filament_soluble");
optgroup = page->new_optgroup(_(L("Print speed override")));
@ -1517,7 +1528,7 @@ void TabFilament::build()
page = add_options_page(_(L("Custom G-code")), "cog");
optgroup = page->new_optgroup(_(L("Start G-code")), 0);
Option option = optgroup->get_option("start_filament_gcode");
option = optgroup->get_option("start_filament_gcode");
option.opt.full_width = true;
option.opt.height = gcode_field_height;// 150;
optgroup->append_single_option_line(option);
@ -1690,7 +1701,10 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
return sizer;
};
Line host_line = optgroup->create_single_option_line("print_host");
// Set a wider width for a better alignment
Option option = optgroup->get_option("print_host");
option.opt.width = Field::def_width_wider();
Line host_line = optgroup->create_single_option_line(option);
host_line.append_widget(printhost_browse);
host_line.append_widget(print_host_test);
optgroup->append_line(host_line);
@ -3497,7 +3511,6 @@ void TabSLAMaterial::build()
for (auto& axis : axes) {
auto opt = optgroup->get_option(opt_key, id);
opt.opt.label = axis;
opt.opt.width = 6;
line.append_option(opt);
++id;
}

View file

@ -290,7 +290,7 @@ public:
virtual void reload_config();
void update_mode();
void update_visibility();
void msw_rescale();
virtual void msw_rescale();
Field* get_field(const t_config_option_key& opt_key, int opt_index = -1) const;
bool set_value(const t_config_option_key& opt_key, const boost::any& value);
wxSizer* description_line_widget(wxWindow* parent, ogStaticText** StaticText);
@ -403,6 +403,7 @@ public:
void build_unregular_pages();
void on_preset_loaded() override;
void init_options_list() override;
void msw_rescale() override;
bool supports_printer_technology(const PrinterTechnology /* tech */) override { return true; }
};