mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Fixed wrong drawing of the object additional settings
This commit is contained in:
parent
c19fe985e8
commit
f7c0303acf
3 changed files with 18 additions and 8 deletions
|
@ -687,7 +687,12 @@ void object_ctrl_selection_changed()
|
||||||
//update_optgroup
|
//update_optgroup
|
||||||
void update_settings_list()
|
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.
|
// 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,
|
// 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.
|
// we will Thaw the UI prematurely on Linux. This means destroing the no_updates object prematurely.
|
||||||
|
@ -701,7 +706,7 @@ void update_settings_list()
|
||||||
|
|
||||||
if (m_config)
|
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
|
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);
|
no_updates.reset(nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_right_panel()->Refresh();
|
get_right_panel()->Layout();
|
||||||
get_right_panel()->GetParent()->Layout();;
|
get_right_panel()->GetParent()->Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_settings_choice(wxMenu *menu, int id, bool is_part)
|
void get_settings_choice(wxMenu *menu, int id, bool is_part)
|
||||||
|
|
|
@ -158,7 +158,7 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** colored_Label/*
|
||||||
// if we have an extra column, build it
|
// if we have an extra column, build it
|
||||||
if (extra_column) {
|
if (extra_column) {
|
||||||
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 {
|
else {
|
||||||
// if the callback provides no sizer for the extra cell, put a spacer
|
// if the callback provides no sizer for the extra cell, put a spacer
|
||||||
|
|
|
@ -75,7 +75,7 @@ private:
|
||||||
std::vector<widget_t> m_extra_widgets;//! {std::vector<widget_t>()};
|
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_optionfield_map = std::map<t_config_option_key, t_field>;
|
||||||
using t_opt_map = std::map< std::string, std::pair<std::string, int> >;
|
using t_opt_map = std::map< std::string, std::pair<std::string, int> >;
|
||||||
|
@ -107,6 +107,11 @@ public:
|
||||||
return m_parent;
|
return m_parent;
|
||||||
#endif /* __WXGTK__ */
|
#endif /* __WXGTK__ */
|
||||||
}
|
}
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
wxWindow* get_parent() const {
|
||||||
|
return m_parent;
|
||||||
|
}
|
||||||
|
#endif /* __WXGTK__ */
|
||||||
|
|
||||||
void append_line(const Line& line, wxStaticText** colored_Label = nullptr);
|
void append_line(const Line& line, wxStaticText** colored_Label = nullptr);
|
||||||
Line create_single_option_line(const Option& option) const;
|
Line create_single_option_line(const Option& option) const;
|
||||||
|
@ -157,7 +162,7 @@ public:
|
||||||
staticbox(title!=""), m_flag(flag), extra_column(extra_clmn){
|
staticbox(title!=""), m_flag(flag), extra_column(extra_clmn){
|
||||||
stb = new wxStaticBox(_parent, wxID_ANY, title);
|
stb = new wxStaticBox(_parent, wxID_ANY, title);
|
||||||
stb->SetFont(bold_font());
|
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;
|
auto num_columns = 1U;
|
||||||
if (label_width != 0) num_columns++;
|
if (label_width != 0) num_columns++;
|
||||||
if (extra_column != nullptr) num_columns++;
|
if (extra_column != nullptr) num_columns++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue