mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
A bunch of tab fixes (#6551)
* Make sure the speed tab is properly hidden when toggle off advance mode * Clear each page before clearing the parent, otherwise the child pages will be destroyed twice * Fix crash if current selected tab is positioned after the removed tab * Fix issue that sometimes the printer config first page is not displayed * Fix issue that the wrong tab item get bold if the number of tabs changed
This commit is contained in:
@@ -492,13 +492,16 @@ bool OG_CustomCtrl::update_visibility(ConfigOptionMode mode)
|
||||
wxCoord h_pos2 = get_title_width() * m_em_unit;
|
||||
wxCoord v_pos = 0;
|
||||
|
||||
size_t invisible_lines = 0;
|
||||
bool has_visible_lines = false;
|
||||
for (CtrlLine& line : ctrl_lines) {
|
||||
line.update_visibility(mode);
|
||||
if (line.is_visible)
|
||||
if (line.is_visible) {
|
||||
v_pos += (wxCoord)line.height;
|
||||
else
|
||||
invisible_lines++;
|
||||
|
||||
if (!line.is_separator()) { // Ignore separators
|
||||
has_visible_lines = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// BBS: multi-line title
|
||||
SetFont(Label::Head_16);
|
||||
@@ -513,7 +516,7 @@ bool OG_CustomCtrl::update_visibility(ConfigOptionMode mode)
|
||||
|
||||
this->SetMinSize(wxSize(h_pos, v_pos));
|
||||
|
||||
return invisible_lines != ctrl_lines.size();
|
||||
return has_visible_lines;
|
||||
}
|
||||
|
||||
// BBS: call by Tab/Page
|
||||
|
||||
Reference in New Issue
Block a user