mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-14 16:02:55 +00:00
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
This commit is contained in:
committed by
GitHub
parent
57535f30ba
commit
d5638273c6
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user