mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-14 16:02:55 +00:00
Add preference for filament area height to reduce scrolling while using 16+ filaments (#12317)
Fixes https://github.com/OrcaSlicer/OrcaSlicer/issues/12284 Adds a preference for filaments area height since every user has different amount of MM units and external filaments so users can set a value that fits their setups this way we might see 3 or 6 filaments for each unit on future. thats why i set value as int used 10 as default value. its good for 2 multimaterial units ( 8 filaments ) and 1 external filament min value is 8. might be good when no external filaments in use max value is 99. UI works same as 2.3.1 version <img width="562" height="122" alt="Screenshot-20260215194149" src="https://github.com/user-attachments/assets/309cec36-8b83-48f3-875f-d5f22a9631e7" /> **BEFORE** Scrollable area fixed for 10 items. that causes a lot of scrolling whe user has 3 or 4 ams units <img width="411" height="237" alt="Screenshot-20260215194816" src="https://github.com/user-attachments/assets/fc7823c0-d82a-4d1f-bb5b-56e8dd47abd2" /> **AFTER** value 10. - 2 multimaterial units ( 8 filaments ) and 1 external filament <img width="1002" height="250" alt="Screenshot-20260215195243" src="https://github.com/user-attachments/assets/e3238cd1-788e-4ed2-b048-89c63bd323db" /> value 18 - 4 multimaterial units ( 16 filaments ) and 1 external filament <img width="1001" height="355" alt="Screenshot-20260215195127" src="https://github.com/user-attachments/assets/afe0305e-fcb4-4a51-b8dc-e70a063aa391" />
This commit is contained in:
@@ -469,6 +469,7 @@ struct Sidebar::priv
|
||||
ScalableButton * m_bpButton_ams_filament;
|
||||
ScalableButton * m_bpButton_set_filament;
|
||||
int m_menu_filament_id = -1;
|
||||
int filament_area_height;
|
||||
wxScrolledWindow* m_panel_filament_content;
|
||||
wxScrolledWindow* m_scrolledWindow_filament_content;
|
||||
wxStaticLine* m_staticline2;
|
||||
@@ -2105,10 +2106,14 @@ Sidebar::Sidebar(Plater *parent)
|
||||
bSizer39->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
|
||||
|
||||
// add filament content
|
||||
// ORCA use a height with user preference
|
||||
int filament_count_user = std::stoi(wxGetApp().app_config->get("filaments_area_preferred_count"));
|
||||
p->filament_area_height = std::ceil(filament_count_user * 0.5) * (30 + SidebarProps::ElementSpacing()) - SidebarProps::ElementSpacing();
|
||||
|
||||
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->SetMaxSize(wxSize{-1, FromDIP(p->filament_area_height)}); // ORCA
|
||||
p->m_panel_filament_content->SetBackgroundColour(wxColour(255, 255, 255));
|
||||
|
||||
//wxBoxSizer* bSizer_filament_content;
|
||||
@@ -3519,7 +3524,7 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
|
||||
for (auto& c : p->combos_filament)
|
||||
c->update();
|
||||
// Expand filament list
|
||||
p->m_panel_filament_content->SetMaxSize({-1, FromDIP(174)});
|
||||
p->m_panel_filament_content->SetMaxSize({-1, FromDIP(p->filament_area_height)}); // ORCA
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user