Fixed wrong drawing of the object additional settings

This commit is contained in:
YuSanka 2018-07-27 10:42:54 +02:00
parent c19fe985e8
commit f7c0303acf
3 changed files with 18 additions and 8 deletions

View file

@ -687,11 +687,16 @@ void object_ctrl_selection_changed()
//update_optgroup
void update_settings_list()
{
auto parent = get_optgroup(ogFrequentlyObjectSettings)->parent();
#ifdef __WXGTK__
auto parent = get_optgroup(ogFrequentlyObjectSettings)->get_parent();
#else
auto parent = get_optgroup(ogFrequentlyObjectSettings)->parent();
#endif /* __WXGTK__ */
// There is a bug related to Ubuntu overlay scrollbars, see https://github.com/prusa3d/Slic3r/issues/898 and https://github.com/prusa3d/Slic3r/issues/952.
// The issue apparently manifests when Show()ing a window with overlay scrollbars while the UI is frozen. For this reason,
// we will Thaw the UI prematurely on Linux. This means destroing the no_updates object prematurely.
#ifdef __linux__
#ifdef __linux__
std::unique_ptr<wxWindowUpdateLocker> no_updates(new wxWindowUpdateLocker(parent));
#else
wxWindowUpdateLocker noUpdates(parent);
@ -701,7 +706,7 @@ void update_settings_list()
if (m_config)
{
auto extra_column = [parent](const Line& line)
auto extra_column = [](wxWindow* parent, const Line& line)
{
auto opt_key = (line.get_options())[0].opt_id; //we assume that we have one option per line
@ -759,8 +764,8 @@ void update_settings_list()
no_updates.reset(nullptr);
#endif
get_right_panel()->Refresh();
get_right_panel()->GetParent()->Layout();;
get_right_panel()->Layout();
get_right_panel()->GetParent()->Layout();
}
void get_settings_choice(wxMenu *menu, int id, bool is_part)

View file

@ -158,7 +158,7 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** colored_Label/*
// if we have an extra column, build it
if (extra_column) {
if (extra_column) {
grid_sizer->Add(extra_column(line), 0, wxALIGN_CENTER_VERTICAL, 0);
grid_sizer->Add(extra_column(parent(), line), 0, wxALIGN_CENTER_VERTICAL, 0);
}
else {
// if the callback provides no sizer for the extra cell, put a spacer

View file

@ -75,7 +75,7 @@ private:
std::vector<widget_t> m_extra_widgets;//! {std::vector<widget_t>()};
};
using column_t = std::function<wxWindow*(const Line&)>;//std::function<wxSizer*(const Line&)>;
using column_t = std::function<wxWindow*(wxWindow* parent, const Line&)>;//std::function<wxSizer*(const Line&)>;
using t_optionfield_map = std::map<t_config_option_key, t_field>;
using t_opt_map = std::map< std::string, std::pair<std::string, int> >;
@ -107,6 +107,11 @@ public:
return m_parent;
#endif /* __WXGTK__ */
}
#ifdef __WXGTK__
wxWindow* get_parent() const {
return m_parent;
}
#endif /* __WXGTK__ */
void append_line(const Line& line, wxStaticText** colored_Label = nullptr);
Line create_single_option_line(const Option& option) const;
@ -157,7 +162,7 @@ public:
staticbox(title!=""), m_flag(flag), extra_column(extra_clmn){
stb = new wxStaticBox(_parent, wxID_ANY, title);
stb->SetFont(bold_font());
sizer = (staticbox ? new wxStaticBoxSizer(stb/*new wxStaticBox(_parent, wxID_ANY, title)*/, wxVERTICAL) : new wxBoxSizer(wxVERTICAL));
sizer = (staticbox ? new wxStaticBoxSizer(stb, wxVERTICAL) : new wxBoxSizer(wxVERTICAL));
auto num_columns = 1U;
if (label_width != 0) num_columns++;
if (extra_column != nullptr) num_columns++;