Sidebar margin & spacing fixes (#6238)

* fix alignments for tab and sidebar icons

* minimize code changes

* minimize code changes

* minimize code changes

* Align config label with group title

* minimize changes

* Update Plater.cpp

* Update spacing after titlebar text and comments

* Update Plater.cpp

* Update OG_CustomCtrl.cpp

* Use class to control values from one place

* fix error

* Update Plater.cpp

* update
This commit is contained in:
yw4z 2025-03-03 06:13:51 +03:00 committed by GitHub
parent 632eff6a3a
commit d9f4e6b8ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 64 additions and 47 deletions

View file

@ -328,7 +328,7 @@ void OG_CustomCtrl::OnPaint(wxPaintEvent&)
wxPaintDC dc(this); wxPaintDC dc(this);
wxCoord h_pos = get_title_width() * m_em_unit; wxCoord h_pos = get_title_width() * m_em_unit + 4; // ORCA Align label with group title. StaticLine.cpp uses 18px for icon 5px for spacing. Spacing doesnt scales on messureSize()
wxCoord v_pos = 0; wxCoord v_pos = 0;
// BBS: new layout // BBS: new layout
if (!GetLabel().IsEmpty()) { if (!GetLabel().IsEmpty()) {

View file

@ -360,9 +360,9 @@ void ParamsPanel::create_layout()
if (m_top_panel) { if (m_top_panel) {
m_mode_sizer = new wxBoxSizer( wxHORIZONTAL ); m_mode_sizer = new wxBoxSizer( wxHORIZONTAL );
m_mode_sizer->AddSpacer(FromDIP(11)); m_mode_sizer->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_process_icon, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(11)); m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add( m_title_label, 0, wxALIGN_CENTER ); m_mode_sizer->Add( m_title_label, 0, wxALIGN_CENTER );
m_mode_sizer->AddStretchSpacer(2); m_mode_sizer->AddStretchSpacer(2);
m_mode_sizer->Add(m_mode_region, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_mode_region, 0, wxALIGN_CENTER);
@ -370,14 +370,14 @@ void ParamsPanel::create_layout()
m_mode_sizer->Add(m_tips_arrow, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_tips_arrow, 0, wxALIGN_CENTER);
m_mode_sizer->AddStretchSpacer(8); m_mode_sizer->AddStretchSpacer(8);
m_mode_sizer->Add( m_title_view, 0, wxALIGN_CENTER ); m_mode_sizer->Add( m_title_view, 0, wxALIGN_CENTER );
m_mode_sizer->AddSpacer(FromDIP(2)); m_mode_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_mode_sizer->Add(m_mode_view, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_mode_view, 0, wxALIGN_CENTER);
m_mode_sizer->AddStretchSpacer(2); m_mode_sizer->AddStretchSpacer(2);
m_mode_sizer->Add(m_setting_btn, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_setting_btn, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(2)); m_mode_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing()));
m_mode_sizer->Add(m_compare_btn, 0, wxALIGN_CENTER); m_mode_sizer->Add(m_compare_btn, 0, wxALIGN_CENTER);
m_mode_sizer->AddSpacer(FromDIP(8)); m_mode_sizer->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
//m_mode_sizer->Add( m_search_btn, 0, wxALIGN_CENTER ); //m_mode_sizer->Add( m_search_btn, 0, wxALIGN_CENTER );
//m_mode_sizer->AddSpacer(16); //m_mode_sizer->AddSpacer(16);
m_mode_sizer->SetMinSize(-1, FromDIP(30)); m_mode_sizer->SetMinSize(-1, FromDIP(30));

View file

@ -313,6 +313,11 @@ enum class ActionButtonType : int {
abSendGCode 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 Sidebar::priv struct Sidebar::priv
{ {
Plater *plater; Plater *plater;
@ -714,11 +719,12 @@ Sidebar::Sidebar(Plater *parent)
}); });
wxBoxSizer* h_sizer_title = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* h_sizer_title = new wxBoxSizer(wxHORIZONTAL);
h_sizer_title->Add(p->m_printer_icon, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, em); h_sizer_title->Add(p->m_printer_icon, 0, wxALIGN_CENTRE | wxLEFT, FromDIP(SidebarProps::TitlebarMargin()));
h_sizer_title->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
h_sizer_title->Add(p->m_text_printer_settings, 0, wxALIGN_CENTER); h_sizer_title->Add(p->m_text_printer_settings, 0, wxALIGN_CENTER);
h_sizer_title->AddStretchSpacer(); h_sizer_title->AddStretchSpacer();
h_sizer_title->Add(p->m_printer_setting, 0, wxALIGN_CENTER); h_sizer_title->Add(p->m_printer_setting, 0, wxALIGN_CENTER);
h_sizer_title->Add(15 * em / 10, 0, 0, 0, 0); h_sizer_title->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
h_sizer_title->SetMinSize(-1, 3 * em); h_sizer_title->SetMinSize(-1, 3 * em);
p->m_panel_printer_title->SetSizer(h_sizer_title); p->m_panel_printer_title->SetSizer(h_sizer_title);
@ -775,11 +781,10 @@ Sidebar::Sidebar(Plater *parent)
wxBoxSizer* hsizer_printer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* hsizer_printer = new wxBoxSizer(wxHORIZONTAL);
vsizer_printer->AddSpacer(FromDIP(16)); vsizer_printer->AddSpacer(FromDIP(16));
hsizer_printer->Add(combo_printer, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3)); hsizer_printer->Add(combo_printer, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ContentMargin()));
hsizer_printer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3)); hsizer_printer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ElementSpacing()));
hsizer_printer->Add(FromDIP(8), 0, 0, 0, 0); hsizer_printer->Add(connection_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
hsizer_printer->Add(connection_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3)); hsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
hsizer_printer->Add(FromDIP(8), 0, 0, 0, 0);
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND, 0); vsizer_printer->Add(hsizer_printer, 0, wxEXPAND, 0);
// Bed type selection // Bed type selection
@ -825,8 +830,9 @@ Sidebar::Sidebar(Plater *parent)
int bed_type_idx = bed_type_value - 1; int bed_type_idx = bed_type_value - 1;
m_bed_type_list->Select(bed_type_idx); m_bed_type_list->Select(bed_type_idx);
bed_type_sizer->Add(bed_type_title, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(10)); bed_type_sizer->Add(bed_type_title, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::ContentMargin()));
bed_type_sizer->Add(m_bed_type_list, 1, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10)); bed_type_sizer->Add(m_bed_type_list, 1, wxLEFT | wxEXPAND, FromDIP(SidebarProps::ElementSpacing()));
bed_type_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
vsizer_printer->Add(bed_type_sizer, 0, wxEXPAND | wxTOP, FromDIP(5)); vsizer_printer->Add(bed_type_sizer, 0, wxEXPAND | wxTOP, FromDIP(5));
vsizer_printer->AddSpacer(FromDIP(16)); vsizer_printer->AddSpacer(FromDIP(16));
@ -865,7 +871,8 @@ Sidebar::Sidebar(Plater *parent)
bSizer39 = new wxBoxSizer( wxHORIZONTAL ); bSizer39 = new wxBoxSizer( wxHORIZONTAL );
p->m_filament_icon = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "filament"); p->m_filament_icon = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "filament");
p->m_staticText_filament_settings = new Label(p->m_panel_filament_title, _L("Filament"), LB_PROPAGATE_MOUSE_EVENT); p->m_staticText_filament_settings = new Label(p->m_panel_filament_title, _L("Filament"), LB_PROPAGATE_MOUSE_EVENT);
bSizer39->Add(p->m_filament_icon, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(10)); bSizer39->Add(p->m_filament_icon, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::TitlebarMargin()));
bSizer39->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
bSizer39->Add( p->m_staticText_filament_settings, 0, wxALIGN_CENTER ); bSizer39->Add( p->m_staticText_filament_settings, 0, wxALIGN_CENTER );
bSizer39->Add(FromDIP(10), 0, 0, 0, 0); bSizer39->Add(FromDIP(10), 0, 0, 0, 0);
bSizer39->SetMinSize(-1, FromDIP(30)); bSizer39->SetMinSize(-1, FromDIP(30));
@ -937,7 +944,6 @@ Sidebar::Sidebar(Plater *parent)
bSizer39->Add(p->m_flushing_volume_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5)); bSizer39->Add(p->m_flushing_volume_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5));
bSizer39->Hide(p->m_flushing_volume_btn); bSizer39->Hide(p->m_flushing_volume_btn);
bSizer39->Add(FromDIP(10), 0, 0, 0, 0 );
ScalableButton* add_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "add_filament"); ScalableButton* add_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "add_filament");
add_btn->SetToolTip(_L("Add one filament")); add_btn->SetToolTip(_L("Add one filament"));
@ -981,10 +987,9 @@ Sidebar::Sidebar(Plater *parent)
}); });
p->m_bpButton_del_filament = del_btn; p->m_bpButton_del_filament = del_btn;
bSizer39->Add(del_btn, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5)); bSizer39->Add(del_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(FromDIP(10), 0, 0, 0, 0); bSizer39->Add(add_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing())); // ORCA Moved add button after delete button to prevent add button position change when remove icon automatically hidden
bSizer39->Add(add_btn, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); // ORCA Moved add button after delete button to prevent add button position change when remove icon automatically hidden bSizer39->AddSpacer(FromDIP(20));
bSizer39->Add(FromDIP(20), 0, 0, 0, 0);
if (p->combos_filament.size() <= 1) { // ORCA Fix Flushing button and Delete filament button not hidden on launch while only 1 filament exist if (p->combos_filament.size() <= 1) { // ORCA Fix Flushing button and Delete filament button not hidden on launch while only 1 filament exist
bSizer39->Hide(p->m_flushing_volume_btn); bSizer39->Hide(p->m_flushing_volume_btn);
@ -999,8 +1004,8 @@ Sidebar::Sidebar(Plater *parent)
}); });
p->m_bpButton_ams_filament = ams_btn; p->m_bpButton_ams_filament = ams_btn;
bSizer39->Add(ams_btn, 0, wxALIGN_CENTER|wxALL, FromDIP(5)); bSizer39->Add(ams_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(FromDIP(10), 0, 0, 0, 0 ); //bSizer39->Add(FromDIP(10), 0, 0, 0, 0 );
ScalableButton* set_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "settings"); ScalableButton* set_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "settings");
set_btn->SetToolTip(_L("Set filaments to use")); set_btn->SetToolTip(_L("Set filaments to use"));
@ -1012,8 +1017,8 @@ Sidebar::Sidebar(Plater *parent)
}); });
p->m_bpButton_set_filament = set_btn; p->m_bpButton_set_filament = set_btn;
bSizer39->Add(set_btn, 0, wxALIGN_CENTER); bSizer39->Add(set_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
bSizer39->Add(FromDIP(15), 0, 0, 0, 0); bSizer39->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
// add filament content // add filament content
p->m_panel_filament_content = new wxPanel( p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); p->m_panel_filament_content = new wxPanel( p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
@ -1033,10 +1038,10 @@ Sidebar::Sidebar(Plater *parent)
p->combos_filament[0] = new PlaterPresetComboBox(p->m_panel_filament_content, Preset::TYPE_FILAMENT); p->combos_filament[0] = new PlaterPresetComboBox(p->m_panel_filament_content, Preset::TYPE_FILAMENT);
auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL);
// BBS: filament double columns // BBS: filament double columns
combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0); combo_and_btn_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
if (p->combos_filament[0]->clr_picker) { if (p->combos_filament[0]->clr_picker) {
p->combos_filament[0]->clr_picker->SetLabel("1"); p->combos_filament[0]->clr_picker->SetLabel("1");
combo_and_btn_sizer->Add(p->combos_filament[0]->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(3)); combo_and_btn_sizer->Add(p->combos_filament[0]->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT,FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box))
} }
combo_and_btn_sizer->Add(p->combos_filament[0], 1, wxALL | wxEXPAND, FromDIP(2))->SetMinSize({-1, FromDIP(30) }); combo_and_btn_sizer->Add(p->combos_filament[0], 1, wxALL | wxEXPAND, FromDIP(2))->SetMinSize({-1, FromDIP(30) });
@ -1052,8 +1057,8 @@ Sidebar::Sidebar(Plater *parent)
}); });
combobox->edit_btn = edit_btn; combobox->edit_btn = edit_btn;
combo_and_btn_sizer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3)); combo_and_btn_sizer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box))
combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0); combo_and_btn_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
p->combos_filament[0]->set_filament_idx(0); p->combos_filament[0]->set_filament_idx(0);
p->sizer_filaments->GetItem((size_t)0)->GetSizer()->Add(combo_and_btn_sizer, 1, wxEXPAND); p->sizer_filaments->GetItem((size_t)0)->GetSizer()->Add(combo_and_btn_sizer, 1, wxEXPAND);
@ -1164,10 +1169,13 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int filame
auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL);
// BBS: filament double columns // BBS: filament double columns
int em = wxGetApp().em_unit();
combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0 ); // int em = wxGetApp().em_unit();
if ((filament_idx % 2) == 0) // Dont add right column item. this one create equal spacing on left, right & middle
combo_and_btn_sizer->AddSpacer(FromDIP((filament_idx % 2) == 0 ? 12 : 3)); // Content Margin
(*combo)->clr_picker->SetLabel(wxString::Format("%d", filament_idx + 1)); (*combo)->clr_picker->SetLabel(wxString::Format("%d", filament_idx + 1));
combo_and_btn_sizer->Add((*combo)->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(3)); combo_and_btn_sizer->Add((*combo)->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box))
combo_and_btn_sizer->Add(*combo, 1, wxALL | wxEXPAND, FromDIP(2))->SetMinSize({-1, FromDIP(30)}); combo_and_btn_sizer->Add(*combo, 1, wxALL | wxEXPAND, FromDIP(2))->SetMinSize({-1, FromDIP(30)});
/* BBS hide del_btn /* BBS hide del_btn
@ -1196,9 +1204,9 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int filame
}); });
combobox->edit_btn = edit_btn; combobox->edit_btn = edit_btn;
combo_and_btn_sizer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3)); combo_and_btn_sizer->Add(edit_btn, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ElementSpacing()) - FromDIP(2)); // ElementSpacing - 2 (from combo box))
combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0); combo_and_btn_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
// BBS: filament double columns // BBS: filament double columns
auto side = filament_idx % 2; auto side = filament_idx % 2;

View file

@ -107,6 +107,15 @@ using ColorEvent = Event<wxColour>;
wxDECLARE_EVENT(EVT_ADD_CUSTOM_FILAMENT, ColorEvent); wxDECLARE_EVENT(EVT_ADD_CUSTOM_FILAMENT, ColorEvent);
const wxString DEFAULT_PROJECT_NAME = "Untitled"; const wxString DEFAULT_PROJECT_NAME = "Untitled";
class SidebarProps
{
public:
static int TitlebarMargin();
static int ContentMargin();
static int IconSpacing();
static int ElementSpacing();
};
class Sidebar : public wxPanel class Sidebar : public wxPanel
{ {
ConfigOptionMode m_mode; ConfigOptionMode m_mode;

View file

@ -358,25 +358,25 @@ void Tab::create_preset_tab()
m_main_sizer = new wxBoxSizer( wxVERTICAL ); m_main_sizer = new wxBoxSizer( wxVERTICAL );
m_top_sizer = new wxBoxSizer( wxHORIZONTAL ); m_top_sizer = new wxBoxSizer( wxHORIZONTAL );
m_top_sizer->Add(m_undo_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5); m_top_sizer->Add(m_undo_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::ContentMargin()));
// BBS: model config // BBS: model config
if (m_presets_choice) { if (m_presets_choice) {
m_presets_choice->Reparent(m_top_panel); m_presets_choice->Reparent(m_top_panel);
m_top_sizer->Add(m_presets_choice, 1, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 8); m_top_sizer->Add(m_presets_choice, 1, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::ElementSpacing()));
} else { } else {
m_top_sizer->AddSpacer(10); m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_top_sizer->AddStretchSpacer(1); m_top_sizer->AddStretchSpacer(1);
} }
const float scale_factor = /*wxGetApp().*/em_unit(this)*0.1;// GetContentScaleFactor(); const float scale_factor = /*wxGetApp().*/em_unit(this)*0.1;// GetContentScaleFactor();
#ifndef DISABLE_UNDO_SYS #ifndef DISABLE_UNDO_SYS
m_top_sizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL); m_top_sizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL);
m_top_sizer->AddSpacer(8); m_top_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing()));
#endif #endif
m_top_sizer->Add( m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 8 ); m_top_sizer->Add(m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add( m_btn_delete_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 8 ); m_top_sizer->Add(m_btn_delete_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add( m_btn_search, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 8 ); m_top_sizer->Add(m_btn_search, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_top_sizer->Add( m_search_item, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT , 8 ); m_top_sizer->Add(m_search_item, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ContentMargin()));
if (dynamic_cast<TabPrint*>(this) == nullptr) { if (dynamic_cast<TabPrint*>(this) == nullptr) {
m_static_title = new Label(m_top_panel, Label::Body_12, _L("Advance")); m_static_title = new Label(m_top_panel, Label::Body_12, _L("Advance"));
@ -385,13 +385,13 @@ void Tab::create_preset_tab()
m_static_title->Bind(wxEVT_LEFT_UP, [this](auto& e) { m_static_title->Bind(wxEVT_LEFT_UP, [this](auto& e) {
restore_last_select_item(); restore_last_select_item();
}); });
m_top_sizer->Add( m_static_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 8 ); m_top_sizer->Add(m_static_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT); m_mode_view = new SwitchButton(m_top_panel, wxID_ABOUT);
m_top_sizer->AddSpacer(4); m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
m_top_sizer->Add( m_mode_view, 0, wxALIGN_CENTER_VERTICAL); m_top_sizer->Add( m_mode_view, 0, wxALIGN_CENTER_VERTICAL);
} }
m_top_sizer->AddSpacer(10); m_top_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
m_top_sizer->SetMinSize(-1, 3 * m_em_unit); m_top_sizer->SetMinSize(-1, 3 * m_em_unit);
m_top_panel->SetSizer(m_top_sizer); m_top_panel->SetSizer(m_top_sizer);