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

@@ -486,15 +486,15 @@ void BBLTopbar::Rescale() {
item = this->FindTool(wxID_UNDO);
item->SetBitmap(create_scaled_bitmap("topbar_undo", this, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("topbar_undo_inactive", nullptr, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("topbar_undo_inactive", this, TOPBAR_ICON_SIZE));
item = this->FindTool(wxID_REDO);
item->SetBitmap(create_scaled_bitmap("topbar_redo", this, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("topbar_redo_inactive", nullptr, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("topbar_redo_inactive", this, TOPBAR_ICON_SIZE));
item = this->FindTool(ID_CALIB);
item->SetBitmap(create_scaled_bitmap("calib_sf", nullptr, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("calib_sf_inactive", nullptr, TOPBAR_ICON_SIZE));
item->SetBitmap(create_scaled_bitmap("calib_sf", this, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("calib_sf_inactive", this, TOPBAR_ICON_SIZE));
item = this->FindTool(ID_TITLE);

View File

@@ -59,8 +59,8 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
m_dsa_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(0, 0, 0, wxLEFT, FromDIP(120));
btn_sizer->AddStretchSpacer();
btn_sizer->Add(m_dsa_sizer, 0, wxEXPAND);
btn_sizer->AddStretchSpacer();
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND | wxTOP, FromDIP(10));
apply_style(style);

View File

@@ -64,10 +64,10 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
auto input_sizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *label_top = new wxStaticText(this, wxID_ANY, from_u8((boost::format(_utf8(L("Save %s as"))) % into_u8(tab->title())).str()));
label_top->SetFont(::Label::Body_13);
label_top->SetFont(::Label::Body_14);
label_top->SetForegroundColour(wxColour(38,46,48));
m_input_area = new RoundedRectangle(this, wxColor(172, 172, 172), wxDefaultPosition, wxSize(-1,-1), 3, 1);
m_input_area = new RoundedRectangle(this, StateColor::darkModeColorFor(wxColour("#DBDBDB")), wxDefaultPosition, wxSize(-1,-1), 3, 1);
m_input_area->SetMinSize(wxSize(FromDIP(360), FromDIP(32)));
wxBoxSizer *input_sizer_h = new wxBoxSizer(wxHORIZONTAL);
@@ -87,9 +87,9 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
m_valid_label = new wxStaticText(this, wxID_ANY, "");
m_valid_label->SetForegroundColour(wxColor(255, 111, 0));
input_sizer->Add(label_top, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, BORDER_W);
input_sizer->Add(m_input_area, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, BORDER_W);
input_sizer->Add(m_valid_label, 0, wxEXPAND | wxLEFT | wxRIGHT, BORDER_W);
input_sizer->Add(label_top, 0, wxEXPAND | wxLEFT, BORDER_W);
input_sizer->Add(m_input_area, 0, wxEXPAND | wxTOP, BORDER_W);
input_sizer->Add(m_valid_label, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, BORDER_W);
m_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;

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)

View File

@@ -118,10 +118,11 @@ const wxString DEFAULT_PROJECT_NAME = "Untitled";
class SidebarProps
{
public:
static int TitlebarMargin();
static int ContentMargin();
static int IconSpacing();
static int ElementSpacing();
static int TitlebarMargin(){ return 8 ;} // Use as side margins on titlebar. Has less margin on sides to create separation with its content
static int ContentMargin() { return 12;} // Use as side margins contents of title
static int ContentMarginV(){ return 9 ;} // Use as vertical margins contents of title
static int IconSpacing() { return 10;} // Use on main elements
static int ElementSpacing(){ return 5 ;} // Use if elements has relation between them like edit button for combo box etc.
};
class Sidebar : public wxPanel

View File

@@ -1095,7 +1095,7 @@ void PreferencesDialog::create()
m_pref_tabs->SelectItem(0);
m_sizer_body->Add(m_pref_tabs, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
m_sizer_body->Add(m_pref_tabs, 0, wxEXPAND | wxBOTTOM | wxTOP, FromDIP(5));
m_sizer_body->Add(m_parent, 1, wxEXPAND);
SetSizer(m_sizer_body);

View File

@@ -403,7 +403,7 @@ void Tab::create_preset_tab()
m_top_sizer->SetMinSize(-1, 3 * m_em_unit);
m_top_panel->SetSizer(m_top_sizer);
if (m_presets_choice)
m_main_sizer->Add(m_top_panel, 0, wxEXPAND | wxUP | wxDOWN, m_em_unit);
m_main_sizer->Add(m_top_panel, 0, wxEXPAND | wxUP | wxDOWN, FromDIP(SidebarProps::ContentMarginV()));
else
m_top_panel->Hide();