From 8b5388592971a890ea5a91da2595d628d9c9a522 Mon Sep 17 00:00:00 2001 From: yw4z Date: Tue, 18 Nov 2025 16:43:35 +0300 Subject: [PATCH] match vertical margins --- src/slic3r/GUI/Plater.cpp | 9 +++++---- src/slic3r/GUI/Plater.hpp | 1 + src/slic3r/GUI/Tab.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 75e4e7e681..e1867d8c62 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -364,6 +364,7 @@ enum class ActionButtonType : int { 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::ContentMarginV() { return 9; } // Use as vertical 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. @@ -561,9 +562,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 @@ -2165,9 +2166,9 @@ 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->AddSpacer(SidebarProps::ContentMarginV()); sizer_filaments2->Add(p->sizer_filaments, 0, wxEXPAND, 0); - sizer_filaments2->AddSpacer(FromDIP(16)); + sizer_filaments2->AddSpacer(SidebarProps::ContentMarginV()); p->m_panel_filament_content->SetSizer(sizer_filaments2); p->m_panel_filament_content->Layout(); auto min_size = sizer_filaments2->GetMinSize(); diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 9a3e6c5c94..12e4e04e47 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -120,6 +120,7 @@ class SidebarProps public: static int TitlebarMargin(); static int ContentMargin(); + static int ContentMarginV(); static int IconSpacing(); static int ElementSpacing(); }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7a9a1ac39b..1be7ea8d9e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -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();