From d5638273c6394cb5fafeb93afb12c69844f2711e Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Sat, 6 Jun 2026 01:23:34 +0300 Subject: [PATCH] Fix row spacing in objects list (#14053) * Fix row spacing in objects list on MacOS * Update for windows and linux * Update row height for a more compact look while maintaining some spacing --- src/slic3r/GUI/GUI_ObjectList.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 3413266b8e..bc36f20260 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -514,6 +514,16 @@ void ObjectList::create_objects_ctrl() for (int cn = colName; cn < colCount; cn++) GetColumn(cn)->SetWidth(m_columns_width[cn] * em); #endif + + // Force an explicit row height on all platforms so the object-list spacing is + // consistent and the filament colour badge (2*em tall, see + // get_extruder_color_icons()) always fits. This is required on macOS, where wx + // 3.3's native wxDataViewCtrl uses a fixed font-line-height row and does NOT + // grow it to fit custom renderers' GetSize() (badges would otherwise overflow + // and merge into adjacent rows); on Windows/Linux the generic control normally + // derives the height from the renderers, but we set it here too so all + // platforms match. + SetRowHeight(2 * em + FromDIP(2)); } void ObjectList::get_selected_item_indexes(int& obj_idx, int& vol_idx, const wxDataViewItem& input_item/* = wxDataViewItem(nullptr)*/) @@ -6337,6 +6347,11 @@ void ObjectList::msw_rescale() for (int cn = colName; cn < colCount; cn++) GetColumn(cn)->SetWidth(m_columns_width[cn] * em); + // Keep the explicit row height (see create_objects_ctrl) in sync with the + // rescaled em so the filament colour badge keeps fitting after a DPI or theme + // change. + SetRowHeight(2 * em + FromDIP(2)); + // rescale/update existing items with bitmaps m_objects_model->Rescale();