This commit is contained in:
bubnikv 2019-04-12 11:43:41 +02:00
commit 8094cd22da
3 changed files with 39 additions and 25 deletions

View File

@ -61,19 +61,22 @@ ObjectList::ObjectList(wxWindow* parent) :
{
// Fill CATEGORY_ICON
{
// Note: `this` isn't passed to create_scaled_bitmap() here because of bugs in the widget,
// see note in PresetBundle::load_compatible_bitmaps()
// ptFFF
CATEGORY_ICON[L("Layers and Perimeters")] = create_scaled_bitmap(this, "layers");
CATEGORY_ICON[L("Infill")] = create_scaled_bitmap(this, "infill");
CATEGORY_ICON[L("Support material")] = create_scaled_bitmap(this, "support");
CATEGORY_ICON[L("Speed")] = create_scaled_bitmap(this, "time");
CATEGORY_ICON[L("Extruders")] = create_scaled_bitmap(this, "funnel");
CATEGORY_ICON[L("Extrusion Width")] = create_scaled_bitmap(this, "funnel");
// CATEGORY_ICON[L("Skirt and brim")] = create_scaled_bitmap(this, "skirt+brim");
// CATEGORY_ICON[L("Speed > Acceleration")] = create_scaled_bitmap(this, "time");
CATEGORY_ICON[L("Advanced")] = create_scaled_bitmap(this, "wrench");
// ptSLA
CATEGORY_ICON[L("Supports")] = create_scaled_bitmap(this, "sla_supports");
CATEGORY_ICON[L("Pad")] = create_scaled_bitmap(this, "brick.png");
CATEGORY_ICON[L("Layers and Perimeters")] = create_scaled_bitmap(nullptr, "layers");
CATEGORY_ICON[L("Infill")] = create_scaled_bitmap(nullptr, "infill");
CATEGORY_ICON[L("Support material")] = create_scaled_bitmap(nullptr, "support");
CATEGORY_ICON[L("Speed")] = create_scaled_bitmap(nullptr, "time");
CATEGORY_ICON[L("Extruders")] = create_scaled_bitmap(nullptr, "funnel");
CATEGORY_ICON[L("Extrusion Width")] = create_scaled_bitmap(nullptr, "funnel");
// CATEGORY_ICON[L("Skirt and brim")] = create_scaled_bitmap(nullptr, "skirt+brim");
// CATEGORY_ICON[L("Speed > Acceleration")] = create_scaled_bitmap(nullptr, "time");
CATEGORY_ICON[L("Advanced")] = create_scaled_bitmap(nullptr, "wrench");
// ptSLA
CATEGORY_ICON[L("Supports")] = create_scaled_bitmap(nullptr, "sla_supports");
CATEGORY_ICON[L("Pad")] = create_scaled_bitmap(nullptr, "brick.png");
}
// create control
@ -392,10 +395,10 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
void ObjectList::init_icons()
{
m_bmp_modifiermesh = create_scaled_bitmap(this, "lambda.png");
m_bmp_solidmesh = create_scaled_bitmap(this, "object.png");
m_bmp_support_enforcer = create_scaled_bitmap(this, "support_enforcer_.png");
m_bmp_support_blocker = create_scaled_bitmap(this, "support_blocker_.png");
m_bmp_modifiermesh = create_scaled_bitmap(nullptr, "lambda.png");
m_bmp_solidmesh = create_scaled_bitmap(nullptr, "object.png");
m_bmp_support_enforcer = create_scaled_bitmap(nullptr, "support_enforcer_.png");
m_bmp_support_blocker = create_scaled_bitmap(nullptr, "support_blocker_.png");
m_bmp_vector.reserve(4); // bitmaps for different types of parts
@ -406,13 +409,13 @@ void ObjectList::init_icons()
m_objects_model->SetVolumeBitmaps(m_bmp_vector);
// init icon for manifold warning
m_bmp_manifold_warning = create_scaled_bitmap(this, "exclamation_mark_.png");
m_bmp_manifold_warning = create_scaled_bitmap(nullptr, "exclamation_mark_.png");
// init bitmap for "Split to sub-objects" context menu
m_bmp_split = create_scaled_bitmap(this, "split_parts");
m_bmp_split = create_scaled_bitmap(nullptr, "split_parts");
// init bitmap for "Add Settings" context menu
m_bmp_cog = create_scaled_bitmap(this, "cog");
m_bmp_cog = create_scaled_bitmap(nullptr, "cog");
}

View File

@ -801,12 +801,16 @@ bool PresetCollection::delete_current_preset()
void PresetCollection::load_bitmap_default(wxWindow *window, const std::string &file_name)
{
*m_bitmap_main_frame = create_scaled_bitmap(window, file_name);
// XXX: See note in PresetBundle::load_compatible_bitmaps()
(void)window;
*m_bitmap_main_frame = create_scaled_bitmap(nullptr, file_name);
}
void PresetCollection::load_bitmap_add(wxWindow *window, const std::string &file_name)
{
*m_bitmap_add = create_scaled_bitmap(window, file_name);
// XXX: See note in PresetBundle::load_compatible_bitmaps()
(void)window;
*m_bitmap_add = create_scaled_bitmap(nullptr, file_name);
}
const Preset* PresetCollection::get_selected_preset_parent() const

View File

@ -398,10 +398,17 @@ void PresetBundle::export_selections(AppConfig &config)
void PresetBundle::load_compatible_bitmaps(wxWindow *window)
{
*m_bitmapCompatible = create_scaled_bitmap(window, "flag_green");
*m_bitmapIncompatible = create_scaled_bitmap(window, "flag_red");
*m_bitmapLock = create_scaled_bitmap(window, "lock_closed");
*m_bitmapLockOpen = create_scaled_bitmap(window, "sys_unlock.png");
// We don't actually pass the window pointer here and instead generate
// a low DPI bitmap, because the wxBitmapComboBox and wxDataViewCtrl don't support
// high DPI bitmaps very well, they compute their dimensions wrong.
// TODO: Update this when fixed in wxWidgets
// See also PresetCollection::load_bitmap_default() and PresetCollection::load_bitmap_add()
(void)window;
*m_bitmapCompatible = create_scaled_bitmap(nullptr, "flag_green");
*m_bitmapIncompatible = create_scaled_bitmap(nullptr, "flag_red");
*m_bitmapLock = create_scaled_bitmap(nullptr, "lock_closed");
*m_bitmapLockOpen = create_scaled_bitmap(nullptr, "sys_unlock.png");
prints .set_bitmap_compatible(m_bitmapCompatible);
filaments .set_bitmap_compatible(m_bitmapCompatible);