* the editing of extruder color from PresetComboBox,
when incompatible filament preset is selected and red flag is shown.

*OSX specific bug : empty icons for PresetComboBox had non-scaled width
This commit is contained in:
YuSanka 2020-03-06 14:22:14 +01:00
parent e11b9b0faf
commit 6f67a5bccc
2 changed files with 22 additions and 15 deletions

View file

@ -1599,21 +1599,23 @@ void PresetBundle::update_plater_filament_ui(unsigned int idx_extruder, GUI::Pre
// To avoid asserts, each added bitmap to wxBitmapCombobox should be the same size, so
// set a bitmap height to m_bitmapLock->GetHeight()
// Note, under OSX we should use a ScaledHeight because of Retina scale
//
// To avoid asserts, each added bitmap to wxBitmapCombobox should be the same size.
// But for some display scaling (for example 125% or 175%) normal_icon_width differs from icon width.
// So:
// for nonsystem presets set a width of empty bitmap to m_bitmapLock->GetWidth()
// for compatible presets set a width of empty bitmap to m_bitmapIncompatible->GetWidth()
//
// Note, under OSX we should use a Scaled Height/Width because of Retina scale
#ifdef __APPLE__
const int icon_height = m_bitmapLock->GetScaledHeight();
const int lock_icon_width = m_bitmapLock->GetScaledWidth();
const int flag_icon_width = m_bitmapIncompatible->GetScaledWidth();
#else
const int icon_height = m_bitmapLock->GetHeight();
#endif
/* To avoid asserts, each added bitmap to wxBitmapCombobox should be the same size.
* But for some display scaling (for example 125% or 175%) normal_icon_width differs from icon width.
* So:
* for nonsystem presets set a width of empty bitmap to m_bitmapLock->GetWidth()
* for compatible presets set a width of empty bitmap to m_bitmapIncompatible->GetWidth()
**/
const int lock_icon_width = m_bitmapLock->GetWidth();
const int flag_icon_width = m_bitmapIncompatible->GetWidth();
#endif
wxString tooltip = "";