mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-04 05:50:37 -07:00
ENH: scroll filament list
Change-Id: I2958ff68e90a6707eb823b0314d62555012b3173 Jira: STUDIO-11070 (cherry picked from commit 39688286a75b78635dc670e387ac5ab75d0b1d54)
This commit is contained in:
parent
4d3d0c7ef6
commit
9eae5935d9
1 changed files with 15 additions and 3 deletions
|
|
@ -457,7 +457,7 @@ struct Sidebar::priv
|
|||
ScalableButton * m_bpButton_ams_filament;
|
||||
ScalableButton * m_bpButton_set_filament;
|
||||
int m_menu_filament_id = -1;
|
||||
wxPanel* m_panel_filament_content;
|
||||
wxScrolledWindow* m_panel_filament_content;
|
||||
wxScrolledWindow* m_scrolledWindow_filament_content;
|
||||
wxStaticLine* m_staticline2;
|
||||
wxPanel* m_panel_project_title;
|
||||
|
|
@ -1790,8 +1790,11 @@ Sidebar::Sidebar(Plater *parent)
|
|||
bSizer39->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
|
||||
|
||||
// add filament content
|
||||
p->m_panel_filament_content = new wxPanel( p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
p->m_panel_filament_content->SetBackgroundColour( wxColour( 255, 255, 255 ) );
|
||||
p->m_panel_filament_content = new wxScrolledWindow( p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
p->m_panel_filament_content->SetScrollbars(0, 100, 1, 2);
|
||||
p->m_panel_filament_content->SetScrollRate(0, 5);
|
||||
p->m_panel_filament_content->SetMaxSize(wxSize{-1, FromDIP(174)});
|
||||
p->m_panel_filament_content->SetBackgroundColour(wxColour(255, 255, 255));
|
||||
|
||||
//wxBoxSizer* bSizer_filament_content;
|
||||
//bSizer_filament_content = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
|
@ -1813,6 +1816,10 @@ Sidebar::Sidebar(Plater *parent)
|
|||
sizer_filaments2->AddSpacer(FromDIP(16));
|
||||
p->m_panel_filament_content->SetSizer(sizer_filaments2);
|
||||
p->m_panel_filament_content->Layout();
|
||||
auto min_size = sizer_filaments2->GetMinSize();
|
||||
if (min_size.y > p->m_panel_filament_content->GetMaxHeight())
|
||||
min_size.y = p->m_panel_filament_content->GetMaxHeight();
|
||||
p->m_panel_filament_content->SetMinSize(min_size);
|
||||
scrolled_sizer->Add(p->m_panel_filament_content, 0, wxEXPAND, 0);
|
||||
}
|
||||
|
||||
|
|
@ -2585,6 +2592,11 @@ void Sidebar::on_filament_count_change(size_t num_filaments)
|
|||
}
|
||||
}
|
||||
|
||||
auto min_size = p->m_panel_filament_content->GetSizer()->GetMinSize();
|
||||
if (min_size.y > p->m_panel_filament_content->GetMaxHeight())
|
||||
min_size.y = p->m_panel_filament_content->GetMaxHeight();
|
||||
p->m_panel_filament_content->SetMinSize(min_size);
|
||||
|
||||
Layout();
|
||||
p->m_panel_filament_title->Refresh();
|
||||
update_ui_from_settings();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue