UI fixes / improvements (#11413)

* init

* flushing volumes

* vertical margins

* fix titlebar scaling

* fix filament section

* flushing volumes

---------

Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
This commit is contained in:
yw4z
2025-11-22 17:54:36 +03:00
committed by GitHub
parent f48a438b27
commit 9304cc35db
8 changed files with 29 additions and 50 deletions

View File

@@ -348,11 +348,6 @@ enum class ActionButtonType : int {
abSendGCode
};
int SidebarProps::TitlebarMargin() { return 8; } // Use as side margins on titlebar. Has less margin on sides to create separation with its content
int SidebarProps::ContentMargin() { return 12; } // Use as side margins contents of title
int SidebarProps::IconSpacing() { return 10; } // Use on main elements
int SidebarProps::ElementSpacing() { return 5; } // Use if elements has relation between them like edit button for combo box etc.
struct ExtruderGroup : StaticGroup
{
ExtruderGroup(wxWindow * parent, int index, wxString const &title);
@@ -547,9 +542,9 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
hsizer_printer->Add(panel_nozzle_dia , 0, wxLEFT, FromDIP(4));
hsizer_printer->Add(panel_printer_bed, 0, wxLEFT, FromDIP(4));
//hsizer_printer->Add(btn_sync_printer , 0, wxLEFT, FromDIP(4));
vsizer_printer->AddSpacer(FromDIP(8));
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
vsizer_printer->AddSpacer(FromDIP(8));
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
// Printer - extruder
// double
@@ -2099,16 +2094,14 @@ Sidebar::Sidebar(Plater *parent)
//bSizer_filament_content->Add(p->sizer_filaments, 1, wxALIGN_CENTER | wxALL);
wxSizer *sizer_filaments2 = new wxBoxSizer(wxVERTICAL);
sizer_filaments2->AddSpacer(FromDIP(16));
sizer_filaments2->Add(p->sizer_filaments, 0, wxEXPAND, 0);
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);
scrolled_sizer->Add(p->m_panel_filament_content, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(SidebarProps::ContentMarginV())); // ORCA use vertical margin on parent otherwise it shows scrollbar even on 1 filament
}
{
@@ -2769,6 +2762,8 @@ void Sidebar::msw_rescale()
p->m_bpButton_ams_filament->msw_rescale();
p->m_bpButton_set_filament->msw_rescale();
p->m_flushing_volume_btn->Rescale();
set_flushing_volume_warning(is_flush_config_modified()); // ORCA reapply appearance
//BBS
p->left_extruder->Rescale();
p->right_extruder->Rescale();
@@ -2849,6 +2844,7 @@ void Sidebar::sys_color_changed()
p->m_bpButton_ams_filament->msw_rescale();
p->m_bpButton_set_filament->msw_rescale();
p->m_flushing_volume_btn->Rescale();
set_flushing_volume_warning(is_flush_config_modified()); // ORCA reapply appearance
// BBS
#if 0
@@ -3565,21 +3561,12 @@ wxButton* Sidebar::get_wiping_dialog_button()
void Sidebar::set_flushing_volume_warning(const bool flushing_volume_modify)
{
if (flushing_volume_modify){
p->m_flushing_volume_btn->SetBorderColor(wxColour(255, 111, 0));
p->m_flushing_volume_btn->SetTextColor(wxColour(255, 111, 0));
}
else {
StateColor flush_fg_col(std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Normal));
StateColor flush_bd_col(std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(172, 172, 172), StateColor::Normal));
p->m_flushing_volume_btn->SetBorderColor(flush_bd_col);
p->m_flushing_volume_btn->SetTextColor(flush_fg_col);
if(flushing_volume_modify){
p->m_flushing_volume_btn->SetStyle(ButtonStyle::Regular, ButtonType::Compact);
p->m_flushing_volume_btn->SetBorderColor(wxColour("#FF6F00"));
}
else
p->m_flushing_volume_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Compact);
}
void Sidebar::enable_buttons(bool enable)