Alignments of options in settings tabs

+ msw_rescale() is overridden for PrinterTab to rescale of all the option Pages and not just a respect to current print technology
+ A Setting of the option.width in PrintConfig is no need anymore
This commit is contained in:
YuSanka 2020-02-12 12:08:43 +01:00
parent 2e62f03ba8
commit fcd1cf371b
6 changed files with 85 additions and 57 deletions

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());