Skip to content

Commit

Permalink
Fix for #11566 - Preferences missing a scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
YuSanka committed Nov 2, 2023
1 parent 577ba76 commit 38b75d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/slic3r/GUI/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,19 @@ PreferencesDialog::PreferencesDialog(wxWindow* parent) :
build();

wxSize sz = GetSize();
sz.x += em_unit();
bool is_scrollbar_shown = false;

const size_t pages_cnt = tabs->GetPageCount();
for (size_t tab_id = 0; tab_id < pages_cnt; tab_id++) {
wxSizer* tab_sizer = tabs->GetPage(tab_id)->GetSizer();
wxScrolledWindow* scrolled = static_cast<wxScrolledWindow*>(tab_sizer->GetItem(size_t(0))->GetWindow());
scrolled->SetScrollRate(0, 5);

is_scrollbar_shown |= scrolled->GetScrollLines(wxVERTICAL) > 0;
}

if (is_scrollbar_shown)
sz.x += 2*em_unit();
SetSize(sz);

m_highlighter.set_timer_owner(this, 0);
Expand Down

0 comments on commit 38b75d1

Please sign in to comment.