Check selection for PresetComboBox

This commit is contained in:
YuSanka 2018-12-03 15:16:33 +01:00
parent fe8e431356
commit b3c5a62709
2 changed files with 10 additions and 0 deletions

View file

@ -267,6 +267,12 @@ void PresetComboBox::set_label_marker(int item)
this->SetClientData(item, (void*)LABEL_ITEM_MARKER);
}
void PresetComboBox::check_selection()
{
if (this->last_selected != GetSelection())
this->last_selected = GetSelection();
}
// Frequently changed parameters
class FreqChangedParams : public OG_Settings
@ -641,7 +647,10 @@ void Sidebar::update_presets(Preset::Type preset_type)
preset_bundle.sla_materials.update_platter_ui(p->combo_sla_material);
}
// Update the printer choosers, update the dirty flags.
auto prev_selection = p->combo_printer->GetSelection();
preset_bundle.printers.update_platter_ui(p->combo_printer);
if (prev_selection != p->combo_printer->GetSelection())
p->combo_printer->check_selection();
// Update the filament choosers to only contain the compatible presets, update the color preview,
// update the dirty flags.
if (p->plater->printer_technology() == ptFFF) {

View file

@ -44,6 +44,7 @@ public:
void set_label_marker(int item);
void set_extruder_idx(const int extr_idx) { extruder_idx = extr_idx; }
int get_extruder_idx() const { return extruder_idx; }
void check_selection();
private:
typedef std::size_t Marker;