mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-28 15:33:16 +08:00
ENH: scroll filament list
Change-Id: I2958ff68e90a6707eb823b0314d62555012b3173 Jira: STUDIO-11070
This commit is contained in:
parent
9c364779e0
commit
39688286a7
@ -455,7 +455,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;
|
||||
@ -1867,8 +1867,11 @@ Sidebar::Sidebar(Plater *parent)
|
||||
bSizer39->Add(FromDIP(16), 0, 0, 0, 0);
|
||||
|
||||
// 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 );
|
||||
@ -1890,6 +1893,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);
|
||||
}
|
||||
|
||||
@ -2730,6 +2737,11 @@ void Sidebar::on_filament_count_change(size_t num_filaments)
|
||||
sizer->Hide(p->m_flushing_volume_btn);
|
||||
}
|
||||
|
||||
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…
x
Reference in New Issue
Block a user