FIX:fixed color picker control cannot be clicked on Mac OS

Change-Id: I47ea257ced111c7d519c546375d3ba8b808f1d4e
This commit is contained in:
tao wang 2023-05-25 18:12:50 +08:00 committed by Lane.Wei
parent 713e346a11
commit f5960411a3
3 changed files with 6 additions and 5 deletions

View file

@ -671,7 +671,7 @@ void AMSMaterialsSetting::on_clr_picker(wxMouseEvent &event)
}
wxPoint img_pos = m_clr_picker->ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x + FromDIP(50), img_pos.y);
wxPoint popup_pos(img_pos.x - m_color_picker_popup.GetSize().x - FromDIP(95), img_pos.y - FromDIP(65));
m_color_picker_popup.Position(popup_pos, wxSize(0, 0));
m_color_picker_popup.set_ams_colours(ams_colors);
m_color_picker_popup.set_def_colour(m_clr_picker->m_colour);

View file

@ -123,6 +123,7 @@ public:
wxColour m_brand_colour;
std::string m_filament_type;
ColorPickerPopup m_color_picker_popup;
ColorPicker * m_clr_picker;
protected:
void create_panel_normal(wxWindow* parent);
@ -153,7 +154,6 @@ protected:
Button * m_button_confirm;
wxStaticText* m_tip_readonly;
Button * m_button_close;
ColorPicker * m_clr_picker;
wxColourData * m_clrData;
wxPanel * m_panel_kn;

View file

@ -2842,7 +2842,7 @@ void StatusPanel::on_ams_unload(SimpleEvent &event)
void StatusPanel::on_ams_filament_backup(SimpleEvent& event)
{
if (obj /*&& obj->filam_bak.size() > 0*/) {
if (obj && obj->filam_bak.size() > 0) {
AmsReplaceMaterialDialog* m_replace_material_popup = new AmsReplaceMaterialDialog(this);
m_replace_material_popup->update_machine_obj(obj);
m_replace_material_popup->ShowModal();
@ -2968,13 +2968,15 @@ void StatusPanel::on_filament_edit(wxCommandEvent &event)
k_val = wxString::Format("%.3f", tray_it->second->k);
n_val = wxString::Format("%.3f", tray_it->second->n);
wxColor color = AmsTray::decode_color(tray_it->second->color);
m_filament_setting_dlg->set_color(color);
//m_filament_setting_dlg->set_color(color);
std::vector<wxColour> cols;
for (auto col : tray_it->second->cols) {
cols.push_back( AmsTray::decode_color(col));
}
m_filament_setting_dlg->ams_filament_id = tray_it->second->setting_id;
if (m_filament_setting_dlg->ams_filament_id.empty()) {
m_filament_setting_dlg->set_empty_color(color);
}
@ -2982,7 +2984,6 @@ void StatusPanel::on_filament_edit(wxCommandEvent &event)
m_filament_setting_dlg->set_color(color);
}
m_filament_setting_dlg->ams_filament_id = tray_it->second->setting_id;
m_filament_setting_dlg->m_is_third = !MachineObject::is_bbl_filament(tray_it->second->tag_uid);
if (!m_filament_setting_dlg->m_is_third) {
sn_number = tray_it->second->uuid;